Home > DeveloperSection > Interviews > If I write System.exit (0); at the end of the try block, will the finally block still execute?

Posted on    November-20-2014 11:15 PM

 .NET .NET  Exception Handling 
 1 Answer(s)
  1005  View(s)
Rate this:

Sumit Kesarwani

Total Post:782

Posted on    November-21-2014 12:15 AM

No in this case the finally block will not execute because when you say system.exit(0),the control immediately goes out of the program, and thus finally never executes.

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

Follow MindStick