Question: Please help with Java homework Use the code below to answer the next 4 questions. public static void main(String[] args) { try { statement1; method1();
Please help with Java homework
Use the code below to answer the next 4 questions.
public static void main(String[] args) {
try {
statement1;
method1();
statement2;
} catch (ExceptionA ex) {
statement3;
} finally {
statement4;
}
statement5;
}
public static void method1() {
try {
statement6;
} catch (ExceptionB ex) {
statement7;
} catch (ExceptionC ex) {
statement8;
} finally {
statement9;
}
statement10;
}
1.
Which statements will execute if no exception is thrown?
| statement9 |
| statement7 |
| statement1 |
| statement2 |
| statement8 |
| statement6 |
| statement4 |
| statement10 |
| statement3 |
| statement5 2. Which statements will execute if an exception of type ExceptionB is thrown in the try-block of method1 before statement6?
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
