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
How do I create a single-file assembly?
What are virtual classes in c#?
Why do we use interfaces in c#?
Explain how can I get around scope problems in a try/catch?
What is a factory in c#?
Why delegates are safe in c#?
Tell me the difference between call by value and call by reference.
What is the and operator in c#?
In languages without exception-handling facilities, we could send an error-handling procedure as a parameter to each procedure that can detect errors that must be handled. What disadvantages are there to this method?
What does m mean in decimal c#?
Why do we use methods in c#?
What is difference between encapsulation and abstraction in c#?
What is class sortedlist underneath?
Which is the best language for desktop application?
Can a method be sealed in c#?