Use finally block in java | Exception handling

Finally block in java is very important, it has crucial statements that must be executed whether an exception occurs or not. A “finally bock” is used with a try-catch block in java. It follows try or catch block. Important: Java finally block is always executed whether an exception is handled or not. In some cases, Read More…


try catch Java Block | Exception handling example

Try and Catch are blocks in Java programming. It’s used for exception handling in Java. Where try block contains a set of statements where an exception can occur and catch block is where you handle the exceptions. A try block is always followed by a catch block, which handles the exception that occurs in the associated Read More…


When finally block is not executed OR finally block always get executed in Java

The “finally” will be called after the execution of the try or catch code blocks. Some programmers think  finally block always executes, no matter what. But it’s not true. Note: finally will be called after the execution of the try or catch code blocks. Must Read- What is try-catch Java Block? Some condition (cases) where “finally” won’t be called are: System.exit() invoked in block Read More…