Multiple Choice
Assume that inputFile references a Scanner object that was used to open a file. Which of the following while loops shows the correct way to read data from the file until the end of the file is reached?
A) while (inputFile.nextLine == " ")
B) while (inputFile != null)
C) while (!inputFile.EOF)
D) while (inputFile.hasNext() )
Correct Answer:

Verified
Correct Answer:
Verified
Q3: When you open a file with the
Q9: Given the following statement, which statement will
Q18: The _ loop is ideal in situations
Q20: What will be the value of x
Q23: What does the following code do?<br>Scanner keyboard
Q24: This is an item that separates other
Q26: In all but rare cases, loops must
Q30: When the break statement is encountered in
Q45: When you pass the name of a
Q51: When working with the PrintWriter class, which