Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

3 How the market system answers four fundamental questions.

Answered: 1 week ago