Solved

Assume InputFile Is a Scanner Object Used to Read Data

Question 45

Multiple Choice

Assume inputFile is a Scanner object used to read data from a text file that contains a number of lines.Each line contains an arbitrary number of words, with at least one word per line.Select an expression to complete the following code segment, which prints the last word in each line. Assume inputFile is a Scanner object used to read data from a text file that contains a number of lines.Each line contains an arbitrary number of words, with at least one word per line.Select an expression to complete the following code segment, which prints the last word in each line.    A) words.hasNext()  B) line.hasNext()  C) words.hasNextInt()  D) inputFile.hasNext()


A) words.hasNext()
B) line.hasNext()
C) words.hasNextInt()
D) inputFile.hasNext()

Correct Answer:

verifed

Verified

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

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents