Multiple Choice
For the questions below, use the following skeletal code.
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) {...}
}
}
-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 leading to the program terminating
Correct Answer:

Verified
Correct Answer:
Verified
Q22: For the questions below, use the following
Q23: Test scores should fall between 0 and
Q24: Rewrite the following method using try and
Q24: An exception can produce a "call stack
Q25: Explain or provide an example showing how
Q26: If an exception is thrown and is
Q28: A Timer object generates _ at regular
Q30: To implement the KeyListener interface, you must
Q31: Use the code below to answer the
Q32: Write code that will create a BufferedReader