What is Finalize block in .net?

chinmay.sahoo

New member
• Finalize() is called by the runtime

• Is a C# equivalent of destructor, called by Garbage Collector when the object goes out of scope.

• Implement it when you have unmanaged resources in your code, and want to make sure that th se resources are freed when the Garbage collection happens.

• Finalize() can NOT be overridden or called in C#.

• Since, Finalize() is called by the Garbage Collector, it is non-deterministic
 
The Finalized method is used to perform cleanup operations on unmanaged resources happened by the current object before the object is destroyed.
 
Back
Top