Question: 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

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(0)
 Assume that inputFile references a Scanner object that was used to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!