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 does using do in c#?
Why is dll used?
What is the difference between structure and class in c#?
Is c# dictionary a hash table?
What are the different types of classes?
Explain the use of SN.exe
What is the difference between first and firstordefault?
What are annotations in c#?
What is the difference between final finally and finalize in c#?
What is the property of class?
What is a satellite assembly in c#?
What are the boolean data types in c#?
How to rotate an Image in C#?
What are assemblies?
What is use of console?