The Code in a Finally Clause will Never Fail to Execute, Right
Using System.exit(1); in try block will not allow finally code to execute The code in a finally clause is designed to execute regardless of whether an exception is thrown or not. However, there are certain situations where the finally block may not execute. Here are a few scenarios: System.exit(): If the JVM exits, the finally … Read more