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 do you mean by thread safe in c#?
What is difference between C# and VB.NET?
Is string nullable in c#?
What is part of a method signature in c#?
What is string literal in c#?
What is enumerable in c#?
What is delegate in c#?
What is a decimal c#?
What is stringwriter c#?
what is IDisposal interface,IComparable,IEquatable,IFormatable
What is the default modifier for class in c#?
What is the difference between abstract and abstraction?
Explain how to use an extender provider in the project.
What’s a strong name?
Is datetime value type c#?