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.Some lines contain an alphabetic string, while others contain a single integer value.Select an expression to complete the following code segment, which counts the number of integer values in the input file. Assume inputFile is a Scanner object used to read data from a text file that contains a number of lines.Some lines contain an alphabetic string, while others contain a single integer value.Select an expression to complete the following code segment, which counts the number of integer values in the input file.    A) inputFile.hasNext()  B) inputFile.hasNextInt()  C) Character.isDigit(inputFile.next() )  D) inputFile.nextInt()


A) inputFile.hasNext()
B) inputFile.hasNextInt()
C) Character.isDigit(inputFile.next() )
D) inputFile.nextInt()

Correct Answer:

verifed

Verified

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

Related Questions