
Finalize is a special method that is automatically called by the garbage collector (GC) before the object is collected. This method is only called by the GC. The destructor in C# is automatically translated into Finalize. You can see the IL code using IDASM where you will see that destructor is renamed to finalize.
public class A
{
~A()
{
Console.WriteLine("Class A Destructor");
//Clean up unmanaged resources here
}
}
The.