finally
always executed. assert
is true, so the finally
block throws an exception.
In addition, assertions are still disabled by default, which may be the reason that the assertion has never been evaluated.
ps
If assert
is false, finally
will work anyway and throw an exception instead of AssertionError
.
Remember that the finally
block always starts, unless the JVM stops in the try
block.
source share