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

Pushpendra Singh

Total Post:240

Points:1200
Posted by  Pushpendra Singh
C# 
C#
 1455  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.

      Modified On Mar-26-2018 05:38:09 AM

Answer

NEWSLETTER

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