Kelvin Chenhao Lim
posted 9 years ago
I'm pretty sure your teacher meant "System.exit(0)" instead of "System.in(0)". The latter is invalid syntax. As far as I know, invoking System.exit() is the only way to stop a finally block from being executed--and that's because System.exit() immediately terminates all threads and shuts down the JVM. This isn't really a corner case, but it's an extremely bad practice (to say the least).