Multiple Choice
Assuming that inputFile is a Scanner object used to read words from a text file, select an expression to complete the following code segment, which counts the number of words in the input file.
Int count = 0;
While (inputFile.hasNext() )
{
String word = _______________;
Count++;
}
System.out.println(count) ;
A) inputFile.next()
B) inputFile.nextInt()
C) inputFile.nextDouble()
D) inputFile.nextString()
Correct Answer:

Verified
Correct Answer:
Verified
Q18: Insert the missing code in the following
Q19: Consider the following code snippet: Scanner in
Q20: Which method of an exception object will
Q21: Insert the missing code in the following
Q22: Consider the following code snippet: Scanner in
Q24: Consider the following code snippet: throw new
Q25: Which statement about handling exceptions is true?<br>A)
Q27: Consider the following code snippet: System.out.printf("%-12s%8.2f",description,totalPrice);<br>Which of
Q28: Insert the missing code in the following
Q101: The _ method of the Character class