Suppose Exception2 is derived from Exception1. Analyze the following code: ery ( statement1; statement 2/ statement3; }
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Suppose Exception2 is derived from Exception1. Analyze the following code: ery ( statement1; statement 2/ statement3; }
statement 2/ statement3; } catch (Exceptionis ex1) ( J catch (Exception2s ex2) { > O The program has a compile error because these two catch blocks are in wrong order. O If an exception of the Exeception2 type occurs, this exception is caught by the first catch block. O The program has a runtime error because these two catch blocks are in wrong order. O If an exception of the Exeception2 type occurs, this exception is caught by the second catch block. pts
Suppose Exception2 is derived from Exception1. Analyze the following code: ery ( statement1;