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;
    //constructor
    public EmpGkr()
    {
    val = 10;
    }

    //destructor
    ~ EmpGkr()
    {
    val = 0;
    }
}

Learn ReactJs, React Native from akashmittal.com