Multiple Choice
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
Correct Answer:
Verified
Q2: All run-time errors throw exceptions.
Q3: If an exception arises in a catch
Q4: Which of the following is not true
Q5: An exception that could also arise in
Q6: An ArithmeticException is a checked exception.
Q7: Example Code Ch 11-1<br>public static void main(String[]
Q8: Programmers can define their own exceptions by
Q9: The difference between a checked and an
Q10: The Scanner class provides an abstraction for
Q11: Explain or provide an example showing how