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 != null)
{ … }
B) while (!inputFile.EOF)
{ … }
C) while (inputFile.hasNext() )
{ … }
D) while (inputFile.nextLine == " ")
{ … }
Correct Answer:

Verified
Correct Answer:
Verified
Q6: Which of the following are pre-test loops?<br>A)
Q42: What will be the value of x
Q43: Before entering a loop to compute a
Q45: This is a sum of numbers that
Q48: How many times will the following do-while
Q49: This type of loop is ideal in
Q50: Which of the following will open a
Q51: In all but rare cases, loops must
Q54: What will be the value of x
Q55: The while loop has two important parts: