31. Consider the code below:
void myMethod()
{ try
{
fragile();
}
catch( NullPointerException npex )
{
System.out.println( "NullPointerException thrown " );
}
catch( Exception ex )
{
System.out.println( "Exception thrown " );
}
finally
{
System.out.println( "Done with exceptions " );
}
System.out.println( "myMethod is done" );
}
What is printed to standard output if fragile() throws an IllegalArgumentException?
a) "NullPointerException thrown"
b) "Exception thrown"
c) "Done with exceptions"
d) "myMethod is done"
e) Nothing is printed
Is this question, I thought the exception throwed by fragile() was catched by the 2nd catch statement and then the finally statement executed.And then it jumps out of myMethod()
So my answer was b & c.
But the answer in the correct answer was b & c & d. What'd the problem?