Solved

For the Questions Below, Use the Following Skeletal Code

Question 16

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 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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents