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 m1
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
Q12: For the questions below, use the following
Q13: The idea that an object can exist
Q13: Use the code below to answer the
Q14: Use the code below to answer the
Q15: Which of the following classes would you
Q16: An exception can produce a "call stack
Q17: A finally clause will execute
A) only if
Q20: Use the code below to answer the
Q22: Character streams manage
A) byte-sized data
B) binary data
C)
Q37: A processing stream is a data stream
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