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 are the classes contained in a single .NET DLL ?
What is byte c#?
Explain About CLS?
How many classes are there in classification?
How does yield return work c#?
Why is hashset faster?
What is delegate in c#?
What is a collection class in c#?
What is namespace give the example?
What is enum in c#?
What is difference between Enum and Struct?
What is web forms in c#?
Is it possible to inline assembly or il in c# code?
What is inumerable?
What are nested classes in c#?