Multiple Choice
Consider the following code snippet:
Public void readFile(String filename) throws FileNotFoundException
{
File inFile = new File(filename) ;
Scanner in = new Scanner(inFile) ;
) . .
}
If the file cannot be located, which of the following statements about this code is correct?
A) This method must handle the exception in the body of the method.
B) This method will be terminated if the file cannot be located.
C) This method must use a throw statement to pass the error back to its caller.
D) It cannot be determined how the method must handle the exception if the file cannot be located.
Correct Answer:

Verified
Correct Answer:
Verified
Q8: Consider the following code snippet:<br>Public static void
Q9: Insert the missing code in the following
Q11: Consider the following code snippet:<br>Try<br>{<br>PrintWriter outputFile =
Q15: Which of the following statements about checked
Q16: Insert the missing code in the following
Q17: You wish to use the Scanner class's
Q17: Insert the missing code in the following
Q19: Consider the following code snippet: Scanner in
Q56: Which of the following statements about white
Q98: When you start a Java program from