Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Why do we need a finally block in try catch block while
handling exceptions

Answers were Sorted based on User's Feedback



Why do we need a finally block in try catch block while handling exceptions..

Answer / vijay kumar inumella

finally block will be executed irrespective of whether
the exception occured or not.
finally block is generally used to close the database
connections and to dispose the session objects etc.

Is This Answer Correct ?    12 Yes 1 No

Why do we need a finally block in try catch block while handling exceptions..

Answer / linto

For releasing unmanaged related objects from Garbage
collector.While,exception happen,the process flow may be
change.At that situation unmanaged objects like database
connection etc should be close.For that purpose we are
using finally block in try catch block.But,Idisposable is
better in the case of efficiency.

Is This Answer Correct ?    1 Yes 0 No

Why do we need a finally block in try catch block while handling exceptions..

Answer / santosh

The code which should execute at any cost even when an exception occurs that code should be written in finally block
ex-closing a form when exception occurs.

Is This Answer Correct ?    2 Yes 2 No

Why do we need a finally block in try catch block while handling exceptions..

Answer / amit

when we need to forcefully executed the code even any
exception will occurs.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What is datagrid c#?

0 Answers  


What is the root element of an xml file?

0 Answers  


What Is A Multicast Delegate?

0 Answers   Siebel Systems,


How to prevent the error while updating ui control from another thread?

0 Answers  


Where static variables are stored?

0 Answers  


can we throw execption from catchblock

4 Answers   Accenture,


Can non-default constructors be used with single call sao?

0 Answers  


What is linq c#?

0 Answers  


Can multiple catch blocks be executed?

4 Answers   Visual Soft,


You have got 1 million parking slots. At a time a parking slot can be free or not. To get next slot easily which data structure to implement?

0 Answers  


Why do we need abstraction in c#?

0 Answers  


Can we have private constructor in our class file. When we are trying to create instance for the class will it create or throw error regarding that?

5 Answers  


Categories