Originally posted by Mark Henryson:
In the above coding, why the ArrayIndexOutOfBoundsException is not invoking. Only the ArithmeticException is called. Why???
output:
--------
java.lang.ArithmeticException: / by zero
After Catch Statement
What happened to ArrayIndexOutOfBoundsException
Thats because in above code the ArithmeticException occurs before the code reaches to ArrayIndexOutOfBoundsException. I mean as the ArithmeticException occured at line: a = 42/d; the remaining code wont be executed and directly goes into catch(ArithmeticException e){} block. Hope you understood.