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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started