Multiple Choice
Consider the following code snippet: File inputFile = new File("input.txt") ;
You wish to read the contents of this file using a Scanner object. Which of the following is the correct syntax for doing this?
A) Scanner in = Scanner ("input.txt")
B) Scanner in = new Scanner ("input.txt")
C) Scanner in = Scanner.open(inputFile)
D) Scanner in = new Scanner(inputFile)
Correct Answer:

Verified
Correct Answer:
Verified
Q15: Which of the following statements about checked
Q78: Consider the following code snippet: Scanner in
Q79: Which of the following statements about a
Q80: Select the missing expression in the code
Q81: Consider the following code snippet: PrintWriter outputFile
Q82: Which of the following statements about the
Q85: Which of the following statements about reading
Q86: Consider the following code snippet. Scanner inputFile
Q87: The Java compiler requires that your program
Q88: Insert the missing code in the following