using System;
public class Employee
{
public Employee()
Console.WriteLine("Constructor Invoked");
}
~Employee()
Console.WriteLine("Destructor Invoked");
public class TestEmployee
public static void Main(string[] args)
Employee e1 = new Employee(); // Creating an object of Employee which calls the Employee constructor
e1=null; // We are setting the object to null so that Garbage collection can be explicitly called
GC.Collect(); // This calls the destructor