Solved

Assuming That InputFile Is a Scanner Object Used to Read

Question 23

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions