if we create a class and fro that class we created six instance we want only five see example in comment section w ahve to destroy current object how like
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Employee obj = new Employee();
Employee obj1 = new Employee();
Employee obj2 = new Employee();
Employee obj3 = new Employee();
Employee obj4 = new Employee();
Employee obj5 = new Employee();
Employee obj6 = new Employee();
Console.Read();
}
}
class Employee
{
static int count = 0;
public Employee()
{
if (count == 5)
{
// here we need to distroy na current object
}
else
{
count++;
}
}
}
}