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 |
Can abstract class have parameterized constructor?
How do I create a multi language, multi file assembly?
Differentiate between the public and private ?
Is there hashmap in c#?
what is the purpose of using statement in c#
Can you prevent a class from being instantiated?
What is .cs file in c#?
What do you mean by object pooling?
Explain the difference between a sub and a function in c#.
What?s a satellite assembly?
What is var c#?
What?s the difference between System.String and System.StringBuilder classes?