Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     

Difference between Dispose & Finalize

CLR uses the Dispose and Finalize methods for performing garbage collection of runtime objects of .Net applications. CLR has a Garbage Collector(GC) which periodically checks for unused and unreferenced objects in Heap.It call Finalize() method to free the memory used by such objects.

Dispose is another method which is invoked by Garbage Collector to release the memory occupied by an object.Dispose method needs to be explicitly called in code for removing an object from Heap. Dispose method can be invoked only by the classes that IDisposable interface.

In VB.Net, we need to override Finalize as it is does not support destructors.

Share this article   |    Print    |    Article read by 2266 times
Guest user is that user who have done some activity on website without login. Activity contains commenting on any article, uploading an image on website etc.
Related Articles: No related article
Related Interview Questions: