Home > DeveloperSection > Interviews > Will finally block get executed if the exception had not occurred?

Posted on    October-25-2010 12:00 AM

 C# C# 
Ratings:
 2 Answer(s)
  1091  View(s)
Rate this:

Uttam Misra

Total Post:54

Points:270
Posted on    October-30-2010 12:00 AM

Yes

Shankar M

Total Post:3

Points:15
Posted on    February-23-2013 1:00 AM

 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.


Don't want to miss updates? Please click the below button!

Follow MindStick