I was messing around with some try...catch...finally
executions and noticed a breakpoint in finally
won't seem to be hit:
try {
System.out.println("in try");
int num = 5 / 0;
} catch (ArithmeticException e) {
System.out.println("in catch");
} finally {
System.out.println(); //breakpoint here
System.out.println("in finally");
}
The breakpoint in the finally
doesn't seem to hit, however it prints out successfully.
However, if I change the try
to int num = 5 / 1;
, and therefore not going in to the catch
, the breakpoint is hit.
I'm using Netbeans 8.1.
Is there a reason for this?