When the exception array index out of bound is raised,control goes to Catch where exception has been displayed by SOP(e)
After it,next exception that arise is divide y zero.
My question is when i run,only arithmatic exception is displayed though its run after SOP of e is done
Shouldn't the result be below which comes when i separate two line
The System.out.println(); statement is not atomic. Go through its constituent parts with a pencil and paper, and write down the execution of each little part in order. Remember the precedences of the operators in that statement. Then you can see when and how that call completes.
Go on from the catch block to the next bit of code.
At least that's what supposed to happen. When you get to a2 / 0, you suffer an ArithmeticException, which goes back to out, back to System, back to the catch (not caught because it didn't originate in a try), back to the method, and if it doesn't find an appropriate catch, it keeps going until it stops which ever thread it is running in.