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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is access specifier in c#?

781


How many types of constructors are there?

690


What is a console file?

717


Can you explain template pattern?

760


what is the scope of anonymous type ?

783


What are the return types in c#?

720


What is difference between arraylist and list in c#?

627


How is a loop recorder monitored?

718


Is xml tags are case sensitive?

686


What is static void main in c#?

728


What is the difference between finalize() and dispose()?

690


What is data quality assurance?

643


Why do we use delegates in c#?

687


What is a protected class c#?

677


Expalin the way you implement inheritance by using VB.NET/C#?

748