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
Q99: The PrintWriter class is an enhancement of
Q100: When a program throws an exception within
Q101: Consider the following code snippet: Scanner in
Q102: Consider the following code snippet. PrintWriter outputFile
Q103: When reading words using a Scanner object's
Q104: Select an expression to complete the program
Q105: Which of the following statements about command
Q107: Select an expression to complete the following
Q108: Consider the following code snippet: PrintWriter out
Q109: Consider the following code snippet: Scanner in