Difference Between dispose and finalize method?

 Posted by Majith on 7/19/2008 | Category: C# Interview questions | Views: 15667
Answer:

Dispose is a method for realse from the memory for an object.

For eg:

<object>.Dispose.

Finalize is used to fire when the object is going to realize the memory.We can set a alert message to says that this object is going to dispose.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Akshaynit on: 2/2/2017 | Points: 10
Finalize: undeterministic nondeterministic destructor/finalizer called automatically by the Garbage Collector when there are no more references to this instance.

Dispose: deterministically called by the developer on an object implementing IDisposable to free resources.

Login to post response