Solved

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

Question 98

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents