0
Exception java help
what is wrong with my code?why it cant detect the 2nd exception?it only shows the first one.how do i make it show two exceptions https://code.sololearn.com/c3lDhTZpfd4f/?ref=app
3 odpowiedzi
+ 5
The reason is when it encounters the first exception it woun't continue executing the rest of the code. So it never encounters the second exception. To see that you can define a variable say z out side of the try/catch statement and change it immediately after the first exception and also define a finally block and print z. You will see that z has not been changed after the first exception.
+ 1
i supposed after java see 1st error a [5] it is jump to catch, that's it
0
how do i make it catch two exceptions?