What is Different between Finalize() and Dispose()? [Resolved]

Posted by Kumarkrishna184 under .NET Framework on 4/8/2016 | Points: 10 | Views : 542 | Status : [Member] | Replies : 1
Different between Finalize() and Dispose()?

Thanks and Regards,
Krishna Kumar



Responses

Posted by: Rajnilari2015 on: 4/10/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
@Kumarkrishna184 Sir, this question has been answered multiple times at DNF.

a) http://www.dotnetfunda.com/articles/show/2786/difference-between-finalize-and-dispose-methods

b) http://www.dotnetfunda.com/interviews/show/5035/difference-between-finalize-and-dispose

c) http://www.dotnetfunda.com/interviews/show/3950/difference-between-finalize-and-dispose-methods

d) http://www.dotnetfunda.com/interviews/show/7427/what-is-the-difference-between-finalize-and-dispose-method-in-dot-net

e) http://www.dotnetfunda.com/articles/show/2479/finalize-dispose-pattern-in-csharp

In short

Dispose() is called by as an indication for an object to release any unmanaged resources it has held. Dispose() operates determinalistically due to which it is generally preferred.

Finalize() is used for the same purpose as dispose however finalize doesn't assure the garbage collection of an object.

Hope this helps


--
Thanks & Regards,
RNA Team

Kumarkrishna184, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response