Search this blog

Tuesday, June 29, 2010

Finalize Vs Dispose

Finalize
Dispose
Implicit way to destroy the object
Explicit Way to Destroy Object
It Cannot Override
It Can be Override
It freed up the memory used by the object only when scope of the expired
Dispose is forcibly freed up the memory
It is called by GC at runtime
It is called by user
If you call finalize, it will move to finalize queue, GC will finalize the object by freed up the memory
It will directly freed up the memory
It will be handling by GC, no inconsistent error occur
Error will occur, because it is not controlled by GC

1 comment:

  1. To learn .net, C#, Java, J2EE, Silverlight, Visual Basic, Asp .net with advanced concepts, you can visit http://advanceddotnettutorial.blogspot.com

    ReplyDelete