1
Reply

What is Finalizer in .NET define Dispose and Finalize ?

sanjeev singh

sanjeev singh

Sep 26, 2008
7.7k
0

    We can say that Finalizer are the methods that's helps in cleanp the code that is executed before object is garbage collected .The process is called finalization . There are two methods of finalizer Dispose and Finalize .There is little diffrenet between two of this method . When we call Dispose method is realse all the resources hold by an object as well as all the resorces hold by the parent object.When we call Dispose method it clean managed as well as unmanaged resources. Finalize methd also cleans resources but finalize call dispose clears only the unmanged resources because in finalization the garbase collecter clears all the object hold by managed code so finalization fails to prevent thos one of methd is used that is: GC.SuppressFinalize.

    sanjeev singh
    September 26, 2008
    0