WILL FINALLY BLOCK GET EXECUTED IF THE EXCEPTION HAD NOT OCCURRED?

Pushpendra Singh

Total Post:241

Points:1205
Posted by  Pushpendra Singh
C# 
C#
 1332  View(s)
Ratings:
Rate this:
  1. Uttam Misra

    Post:54

    Points:270
    Will finally block get executed if the exception had not occurred?

    Yes

  1. Shankar M

    Post:3

    Points:15
    Will finally block get executed if the exception had not occurred?

     Any code that must be absolutely executed whether an exception is thrown or not is

     enclosed within the finally block.

    For Ex: If a method opens a file, it must be closed whether an exception is raised or not.

Answer

NEWSLETTER

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