I was reading some article regarding exception handling and came across the following comment that the finally block may not be executed if the JVM exits. so I tried with the following simple example
and can see that the SOP in the finally block is not printing.
I want to understand the other scenarios in which the JVM might exit. I tried putting some code in the try block which throws ArrayIndexOutOfBoundsException but it is printing the statement in the finally block.