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
Q3: What will be the value of x
Q9: What will be the value of x
Q30: What will be the value of x
Q31: How many times will the following do-while
Q32: Given the following statement, which statement will
Q33: A sentinel value _ and signals that
Q35: In all but rare cases, loops must
Q36: What will be the values of x
Q36: What will be printed after the following
Q38: This is a sum of numbers that
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