.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Interview Question >> C# >> Post New Question Subscribe to Interview Questions

Why do we need Try-Finally block?

Posted By :Vinodh     Posted Date :September 26, 2011    Points :40   Category :C# 
The code inside the finally block will be executed even after throwsing the exception, and the statements in the program that followed th finally block will not be executed.

Thus the exception prevents the control from beign transfered to any part of the program execept th finally block.

You can also find related Interview Question to Why do we need Try-Finally block?  below: 

Can code inside multiple catch block be executed?

No, Code can not execute in mutiple catch block (More...)

What is TCB(Transmission Control Block)?

A TCB is a complex data structure that contains informations about each connection. (More...)

What is non static block in java?

Any code written between a { and a } is a non-static block.

for example:

// some code goes here
The non-static block code is executed when a new class is instantiated. It executes before the constructor's execution. Apart from initialization, any other execution like calculation could be given in the non-static block, as a constructor is used for initializing purpose. (More...)

How to block a class from being inherited further?

Use sealed keyword.

Eg: public sealed class TheClass
} (More...)

What is the structure of try catch block?

Begin Try

End Try
Begin Catch

End Catch (More...)

Can we have return statement in Final block?

No,Final block is being run as a effect of exception thrown from try block. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend