What is Dispose method in .NET?
Answers were Sorted based on User's Feedback
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 |
Answer / bhasker
The Dispose method may be called on any instance of any type implementing the IDisposable interface. This is supported by the C# using statement which makes calling Dispose automatically easy.
Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference b/w Arry.copy() and array.clone() method?
Is javascript harder than c#?
What does args mean in c#?
Explain lock, monitors, and mutex object in threading.
Which attribute is used in order that the method can be used as webservice?
What is the use of getcommandlineargs() method in c#.net?
How do you generate documentation from the C# file commented properly with a command-line compiler?
What is the ouput of the following program?
What is regex replace in c#?
What is the difference between TypeOf and GetType?
What is readline c#?
What are the Types of JIT and what is econo-JIT