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 a NullPointerException 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
Q14: An exception that could also arise in
Q15: Example Code Ch 11-1
public static void main(String[]
Q16: An exception can produce a "call stack
Q17: An ArithmeticException is a checked exception.
Q18: A finally clause will execute
A) only if
Q20: An ArithmeticException is Throwable.
Q21: Which of the following is not true
Q22: Character streams manage
A) byte-sized data
B) binary data
C)
Q23: The difference between a checked and an
Q24: Explain or provide an example showing how
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