in a recent post i've learned that there is no method to prevent finally block to be executed but one of my teachers told me that it is possible by using : System.in(0); (in the try block) really confused please help...
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).
posted 10 years ago
so it's not a matter of real concern.. thanks everyone..
Good heavens! What have you done! Here, try to fix it with this tiny ad: