Question
Question : Tracing Exception Handling Use the pseudocode below. Which statements will be executed if: 1.no exceptions are thrown 2.an ExceptionA is thrown in statement8
Question : Tracing Exception Handling
Use the pseudocode below. Which statements will be executed if:
1.no exceptions are thrown
2.an ExceptionA is thrown in statement8
3.an ExceptionB is thrown in statement8
4.an ExceptionC is thrown in statement8
5.an ExceptionD is thrown in statement8
public void methodA() {
statement1
try {
methodB();
statement2
} catch(ExceptionB ex) {
statement3
} catch(ExceptionC ex) {
statement4
} finally {
statement 5
}
statement6
}
public void methodB() {
statement7
try {
statement8 // this statement generates the exception when one is thrown
statement9
} catch(ExceptionA ex) {
statement10
} catch(ExceptionB ex) {
statement11
} finally {
statement12
}
statement13
}
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