Solved

Assume That InputFile References a Scanner Object That Was Used

Question 46

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:

verifed

Verified

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

Related Questions