Question: Suppose we have a method with a try - catch - finally statement and no exceptions are thrown anywhere, which one of the following is
Suppose we have a method with a trycatchfinally statement and no exceptions are thrown anywhere, which one of the following is correct?
Group of answer choices
The try block will be skipped completely and the catch and finally blocks are both executed but the rest of the method will be skipped and the method returns.
The try block, the closest catch block and the finally block will all be executed and the method will return
The try block completes and the finally block and the rest of the method are executed.
The try block and the closest catch block will be executed but not the finally block and the method will return after the last catch block.
The try block will be skipped completely and the catch and finally blocks are both executed.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
