C# Destructor

tutorial and example
tutorial and example

Destructors works in the opposite way. They basically destruct the objects. We can’t send parameter in a destructor. We also can’t apply any modifier to the destructor. Likewise constructor, destructor is invoked automatically.

Let’s see a simple example of destructor:

Output