What is Dispose method in .NET?

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


Please Help Members By Posting Answers For Below Questions

what are the different ways a method can be overloaded?

518


What are functions c#?

564


What is difference between an Structure and Class?

563


Is post back c#?

493


What is the use of jit ? Jit (just - in - time) is a compiler which converts msil code to

521






What is “using” statement in c#?

469


Which class does the remote object has to inherit?

605


Is inheritance possible in c sharp?

626


What are the differences between events and delegates in c#?

462


what is be the overhead, if i use binary transmission. and will it be sent using xml text or how ?

1684


What is a virtual property. Give an example?

515


What are the drawbacks of extending an interface as opposed to extending a class?

466


What is interpolation in programming?

486


What are the commonly used i/o classes?

528


What is difference between an reference type and value type in C#?

561