Why do we need a finally block in try catch block while
handling exceptions
Answer Posted / 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 |
Post New Answer View All Answers
what is a destructor?
What is escape sequence in c#?
What is the difference between array and arraylist in c#?
How do you type a null character?
For methods inside the interface why can’t you specify the accessibility modifier?
What is a datacontract?
What is difference between for and foreach loop in c#?
how to implement a web service in .net
Define Abstract Class in C#
Explain Constructor and destructor?
Why is it not a good idea to use empty destructors?
What is deadlock in c#?
Explain the types of comments in c#?
What is difference between constants and read-only?
Explain About sn.exe