Solved

Assume That InputFile References a Scanner Object That Was Used

Question 47

Multiple Choice

Assume that inputFile references a Scanner object that was used to open a file. Which of the following while loops is 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:

verifed

Verified

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

Related Questions