What is IDisposable interface in .NET?

 Posted by CGN007 on 6/14/2012 | Category: C# Interview questions | Views: 4227 | Points: 40

IDisposable interface is used to release the unmanaged resources in a program.
The garbage collector has no knowledge of unmanaged resources
such as window handles, or open files and streams.
To release these type of resources we make use of the Dispose method by implementing the IDisposable interface.

IDisposable interface, defines a single method named Dispose():
public interface IDisposable
void Dispose();

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response