Question: Suppose that statement 2 may cause an exception in the following code: try { statement 1 ; statement 2 ; statement 3 ; } catch

Suppose that statement2 may cause an exception in the following code: try { statement1; statement2; statement3; } catch (Exception1 ex1){ } catch (Exception2 ex2){ throw ex2; } finally { statement4; } statement5; Answer the following questions: a. If no exception occurs, will statement4 or statement5 be executed? b. If the exception is of type Exception1, will statement4 or statement5 be executed? c. If the exception is of type Exception2, will statement4 or statement5 be executed? d. If the exception is not Exception1 nor Exception2, will statement4 or statement5 be executed?

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!