public static void Main() { Console.WriteLine("Entering into the main method"); CopyConstructor c1 = new CopyConstructor("Jitu"); c1.DisplayName(); CopyConstructor c2 = new CopyConstructor("Eshita"); c2.DisplayName(); CopyConstructor c3 = new CopyConstructor(c1); c3.DisplayName(); CopyConstructor c4 = new CopyConstructor(c2); c4.DisplayName(); }
CopyConstructor(CopyConstructor c) { Console.WriteLine("Second constructor taking The Class as parameter"); this.name = c.name; }