Solved

Consider the Following Code Snippet: Public Void ReadFile(String Filename) Throws

Question 106

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:

verifed

Verified

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

Related Questions