public static void Main()
TwoInstance T1 = new TwoInstance();
TwoInstance T2 = new TwoInstance();
TwoInstance T3 = new TwoInstance();
private static int countInstances=1;
Console.WriteLine("Instance" + countInstances + "Created");
Interlocked.Increment(ref countInstances);
throw new Exception("You cannot create more then two object");
Interlocked.Decrement(ref countInstances);