using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace exo2 { class Program { class X { static int count = 0; public X() { count++; System.Console.WriteLine("Object from class X ( number" + count + ")"); } public void toString() { System.Console.WriteLine(count); } } static void Main(string[] args) { X obj1, obj2; obj1 = new X(); obj2 = new X(); //Console.WriteLine(obj1); //Console.WriteLine(obj2); Console.Read(); } } }