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
Why we use methods in c#?
What is the difference between abstract class and interface in c#?
What .exe means?
Which technology is best for desktop application?
What is cts, clr?
What is a verbatim string literal and why do we use it?
Are tuples mutable c#?
What's different between c# and c/c++?
What is xamarin used for?
What is int parse in c#?
Can you specify an access modifier for an enumeration?
Can a struct be null?
What are static and dynamic variables?
Are arrays value types or reference types?
What does dbml mean in texting?