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.nextLine == " ")
B) while (inputFile != null)
C) while (!inputFile.EOF)
D) while (inputFile.hasNext() )
Correct Answer:
Verified
Q5: The _ is ideal in situations where
Q7: This type of loop will always be
Q9: What will be the values of x
Q10: A loop that repeats a specific number
Q11: What does the following code do?
Scanner keyboard
Q12: How many times will the following do-while
Q13: A for loop normally performs which of
Q14: Before entering a loop to compute a
Q15: How many times will the following do-while
Q21: When working with the PrintWriter class, which
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