user63506
2
Q:

destructor in c# w3schools

/* 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;
    }
}
0

New to Communities?

Join the community