Question: public static void main(String[ ] args) { try { ExceptionThrowerCode etc = new ExceptionThrowerCode( ); etc.m1( ); etc.m2( ); } catch (ArithmeticException ae) { ...

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

Question 23 options:

it is caught in m2

it is not caught leading to the program terminating

it is caught in m3

it is caught in main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!