Example Code Ch 11-1
public static void main(String[] args)
{
try
{
ExceptionThrowerCode etc = new ExceptionThrowerCode() ;
etc.m1() ;
etc.m2() ;
}
catch (ArithmeticException ae) { ... }
}
public class ExceptionThrowerCode
{
...
public void m1()
{
...
}
public void m2()
{
try
{
m3() ;
}
catch(ArithmeticException ae) {...}
catch(NullPointerException npe) {...}
}
public void m3()
{
try
{
...
}
catch(ArithmeticException ae) {...}
}
}
-Refer to Example Code Ch 11-1: If an ArithmeticException arises in the try statement in m3
A) it is caught in main
B) it is caught in m1
C) it is caught in m2
D) it is caught in m3
E) it is not caught and the program terminates
Correct Answer:
Verified
Q10: While the Exception class is part of
Q11: A Java program can handle an exception
Q12: All run-time errors throw exceptions.
Q13: If an exception arises in a catch
Q14: An exception that could also arise in
Q16: An exception can produce a "call stack
Q17: An ArithmeticException is a checked exception.
Q18: A finally clause will execute
A) only if
Q19: Example Code Ch 11-1
public static void main(String[]
Q20: An ArithmeticException is Throwable.
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents