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
Q3: Which of the following messages passed to
Q4: System.err is a(n)
A) input stream
B) GUI dialog
Q5: Assume Exceptionname is a checked exception. If
Q6: NullPointerException and ArithmeticException are both derived from
Q7: Which of the following is not True
Q9: Use the code below to answer the
Q10: The Scanner class provides an abstraction for
Q12: For the questions below, use the following
Q13: Use the code below to answer the
Q22: Character streams manage
A) byte-sized data
B) binary data
C)
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