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?

statement2
statement7
statement1
statement4
statement10
statement8
statement5
statement3
statement6

statement9

3.

Which statements will execute if an exception of type ExceptionA is thrown in the try-block of method1 before statement6?

statement8
statement5
statement2
statement9
statement10
statement4
statement7
statement6
statement1

statement3

4.

Which statements will execute if an exception of type ExceptionM is thrown in the try-block of method1 before statement6?

statement2
statement8
statement10
statement7
statement6
statement3
statement9
statement5
statement1

statement4

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!