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 is the meaning of Object lifetime in OOPS

717


Is a structure a class?

668


Which framework is best for desktop application?

697


Distinguish between system.string and system.text.stringbuilder classes?

664


What is the difference between method and constructor in c#?

677


What is null character in string?

732


What are the types of constructors?

678


Explain about ODP.net

993


What is difference between iqueryable and ienumerable in c#?

626


update data in an xml file which resides in solution itself, using silverlight 4.0

1545


Explain About Iunknown interface Queue

712


How will you get the different language strings?

658


What is mean by c#?

681


What's the difference between the debug class and trace class? Documentation looks the same.

709


What is an assembly qualified name

769