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 |
Why do we use struct in c#?
Why static variables are used?
Does c# support a variable number of arguments?
Can abstract classes be final?
what is generics? can u explain 5 to 6 examples on generics that covers class,method,structure,list,delegates?
What is the difference between throw and throw ex?
What is binding in c#?
Is 0 an unsigned integer?
What is type class in c#?
Will the following code compile?
What's the difference between a static method and a non static method c#?
What is application object in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)