Question: Suppose we have a method with a try - catch - finally statement and in the try block we execute a throw statement to throw

Suppose we have a method with a try-catch-finally statement and in the try block we execute a throw statement to throw an exception. If there is a matching catch clause in the same try-catch-finally statement, which one of the following is correct?
Group of answer choices
A. The remaining statements after the the throw statement are executed followed by the catch and the finally block but the remaining statements in the method will be skipped.
B. The remaining statements after the the throw statement are executed along with the matching catch and finally blocks and the remaining statements in the method.
C. The remaining statements after the the throw statement are executed and the matching catch and the finally blocks are skipped as are any remaining statements in the method.
D. The remaining statements after the the throw statement are skipped as are the matching catch and finally blocks and the remaining statements in the method.
E. The remaining statements after the throw statement are skipped, the matching catch and finally blocks are executed as are any remaining statements in the method

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 Programming Questions!