Question: 19. Consider the following code snippet: try { File inputFile = new File(filename); Scanner in = new Scanner(inputFile); . . . } catch (Exception e)
19. Consider the following code snippet:
try
{ File inputFile = new File(filename);
Scanner in = new Scanner(inputFile);
. . .
}
catch (Exception e)
{ }
Which of the following statements about this code is correct?
a) This code will not catch a FileNotFoundException that occurs in the try block.
b) This code will pass any exceptions back to its caller.
c) This code will catch exceptions that occur in the try block but will do nothing about the exceptions.
d) This code will not catch any exceptions that occur in the try block.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
