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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!