Which Java statements read all words from a text file, and prints the first character of each word?
Assume the following statement is given:
Scanner fscan = new Scanner(new File("data.txt"));Lütfen birini seçin:a. None of the othersb.while (fscan.hasNextLine()){String word = fscan.nextLine();System.out.print(word.charAt(0));}fscan.close();c.while (fscan.hasNext()){String token = fscan.next();System.out.print(token.charAt(0));}fscan.close();d.while (fscan.hasNext()){String word = fscan.next();System.out.print(word[0]);}fscan.close();e.while (fscan.hasNext()){String word = fscan.next();System.out.print(word);}fscan.close();
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here