Check out example codes for "destructor in c# w3schools". It will help you in understanding the concepts better.

Code Example 1

/* What are Destructors?
Destructor is another method that uses the 
class-name but is preceded with a ~ (tilde) operator/symbol. 
Destructors are used to de-initialize object, and the memories 
occupied when constructors are created. You can consider them 
as the opposite of constructors.
public class EmpGkr
    int start;
    public EmpGkr()
    val = 10;

    ~ EmpGkr()
    val = 0;

Learn ReactJs, React Native from