using System;
public class Starter {
public static void Main() {
MyClass obj1 = new MyClass();
MyClass obj2 = new MyClass();
MyClass obj3 = new MyClass();
MyClass.Count(obj1);
MyClass.Count(obj2);
}
}
public class MyClass {
public MyClass() {
++counter;
}
public static void Count(MyClass _this) {
Console.WriteLine("{0} : {1}",
_this.GetType().ToString(),
counter.ToString());
}
private static int counter = 0;
}