This question extends from Try-finally block prevents StackOverflowError.
If I add a catch block, why catch block codes never runs?
public static void foo() {
try {
foo();
} catch(StackOverflowError e) {
System.exit(1); // or System.err.println("ouch!"); whatever
} finally {
foo();
}
}
I refer to JLS Chapter 11.1.3 - Asynchronous Exceptions - is it the reason cause catch block have no chance to run?