WHAT IS THE IMPORTANCE OF FINALLY BLOCK IN EXCEPTION HANDLING ?

Kamlakar Singh

Total Post:80

Points:400
Posted by  Kamlakar Singh
Java 
 802  View(s)
Ratings:
Rate this:
  1. Kamlakar Singh

    Post:80

    Points:400
    What is the importance of finally block in exception handling ?

    A finally block will always be executed, whether or not an exception is actually thrown. Even in the case where the catch statement is missing and an exception is thrown, the finally block will still be executed. Last thing to mention is that the finally block is used to release resources like I/O buffers, database connections, etc.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!