Multiple Choice
Insert the missing code in the following code fragment. This code is intended to open a file and handle the situation where the file cannot be found.
Try
{
String filename = . . .;
Scanner in = new Scanner(new File(filename) ) ;
) . .
}
___________________
{
Exception.printStackTrace() ;
}
A) catch (IOException exception)
B) catch (new exception (IOException) )
C) catch (IllegalArgumentException exception)
D) catch (IOException)
Correct Answer:

Verified
Correct Answer:
Verified
Q25: Which statement about handling exceptions is true?<br>A)
Q45: Insert the missing code in the following
Q49: Insert the missing code in the following
Q55: Insert the missing code in the following
Q58: Under which condition will the PrintWriter constructor
Q59: Which of the following patterns should be
Q74: If the current method in a program
Q86: Consider the following code snippet. Scanner inputFile
Q92: Consider the following code snippet: Scanner in
Q102: Consider the following code snippet. PrintWriter outputFile