|
A good answer might be:main() calls MethodA MethodA calls parseInt() parseInt() throws a NumberFormatException. MethodA catches the exception and prints "Bad Input Data!!" The return statement executes. Control returns to main(). |
Example OutputsHere is the output of the program when the user enters "0". The stack trace is a "snapshop" of the situation at the time of the exception:
Here is the output of the program when the user enters "Rats".
If you have saved the program to a file, change it
so that |
QUESTION 10:Does the stack trace show the situation:
|