|
A destructor is opposite to s constructor. It is called when an object is no more required. The name of the destructor is the same as the class name and is preceded by a tilde(~) sign. Like constructors, a destructor has no return type. C# manages the memory dynamically and uses a garbage collector, running on a separate thread, to execute all destructors on exit. The process of calling a destructor when an object is reclaimed by the garbage collector is called finalization.
|