Java Reference
In-Depth Information
catch (ArithmeticException aeRef)
//Line 11
{
JOptionPane.showMessageDialog( null ,
"Line 12: Exception "
+ aeRef.toString(),
"ArithmeticException",
JOptionPane.ERROR_MESSAGE);
//Line 12
}
catch (NumberFormatException nfeRef)
//Line 13
{
JOptionPane.showMessageDialog( null ,
"Line 14: Exception "
+ nfeRef.toString(),
"NumberFormatException",
JOptionPane.ERROR_MESSAGE);
//Line 14
}
System.exit(0);
//Line 15
}
}
Sample Runs: Figures 11-5 to 11-7 show various sample runs.
Sample Run 1:
FIGURE 11-5 Sample Run 1 of the program ExceptionExample4
 
Search WWH ::




Custom Search