What is the use of DISPOSE method?

 Posted by Punitha on 12/4/2014 | Category: C# Interview questions | Views: 2252 | Points: 40
Answer:

Dispose method belongs to ‘IDisposable’ interface. We had seen in the previous section how bad
it can be to override the finalize method for writing the cleaning of unmanaged resources. So if
any object wants to release its unmanaged code best is to implement I Disposable and override
the Dispose method of I Disposable interface. Now once your class has exposed the Dispose
method it is the responsibility of the client to call the Dispose method to do the cleanup.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response

More Interview Questions by Punitha