Multiple Choice
Assume that inputFile is a Scanner object used to read data from a text file which 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.
Int count = 0;
While (inputFile.hasNextLine() )
{
If (________________________________)
{
Count++;
}
InputFile.nextLine() ;
}
System.out.println(count) ;
A) inputFile.hasNext()
B) inputFile.hasNextInt()
C) inputFile.nextInt()
D) Character.isDigit(inputFile.next() )
Correct Answer:

Verified
Correct Answer:
Verified
Q2: Which of the following statements about using
Q3: Insert the missing code in the following
Q4: Consider the following code snippet: try<br>{<br>PrintWriter outputFile
Q5: When writing a method, which of the
Q6: Which of the following statements about exception
Q7: Insert the missing code in the following
Q8: Your program will read in an existing
Q9: Which Java class implements a file dialog
Q10: What is the purpose of the throw
Q11: Consider the following code snippet: Scanner in