When does the finally clause in java exception block never executes?
August 27, 2010 Leave a comment
The finally clause in the try-catch exeception block always executes, irrespective of the occurence of exeception. This is applicable for the normal java program flow. If the execution flow is stopped irreversibly before the finally clause, then the finally block will not be executed.
How can the user achieve that in Java?
Include “System.exit(1);” before the finally block and stop the execution flow of the java program.