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:
Verified
Q30: What will be the value of x
Q31: What will be the value of x
Q32: Given the following statement, which statement will
Q33: What will be the values of x
Q34: How many times will the following do-while
Q36: What will be printed after the following
Q37: The _ loop is ideal in situations
Q38: How many times will the following for
Q39: Which of the following statements opens a
Q40: Assuming that inputFile references a Scanner object
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents