Answer Posted / susant
The GC call the Finalize () function automatically to
destroy the object called implicit destroy. When you want
to destroy a objects that you think no longer need and free
it from memory, then we will use the dispose function. For
better
Performance we will use the dispose function explicitly.
The Dispose method in .NET belongs to IDisposable interface
and it is best used to release unmanaged objects like File
objects, Windows API objects, Database connection objects,
COM objects etc from the memory. Its performance is better
than the finalize() method.
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
Can we extend sealed class in c#?
Why is lazy loading?
What is difference between array and arraylist in c#?
What is writeline in c#?
What is a string c#?
What are the generation of Garbage Collection in C# .NET ?
What is multiple interface in c#?
What are the new features in c# 2.0?
What is the namespcae generally given to the webpage of the .NET Framework ?
What is the benefit of dependency injection c#?
What is the use of list in c#?
Can you declare a class or a struct as constant?
What happens when thread sleep () method is called?
What are anonymous types in c#?
What is the difference between ienumerable and iqueryable?