| Author: lingesh 14 Oct 2008 | Member Level: Silver Points : 2 |
Ya the copy constructor is the most interesting one because we pass the object during the object creation.
class a { public int x; public a() { x=10; } public a(class z) \\ copy constructor { x=100; } } class b { public static void Main() { a obj1 = new a(); System.Console.WriteLine(x) ; b obj2 = new a(obj1); System.Console.WriteLine(x) ;
} } output 10 100;
|
| Author: lingesh 14 Oct 2008 | Member Level: Silver Points : 2 |
Ya the copy constructor is the most interesting one because we pass the object during the object creation.
class a { public int x; public a() { x=10; } public a(class z) \\ copy constructor { x=100; } } class b { public static void Main() { a obj1 = new a(); System.Console.WriteLine(x) ; b obj2 = new a(obj1); System.Console.WriteLine(x) ;
} } output 10 100;
|
| Author: Meetu Choudhary 14 Oct 2008 | Member Level: Gold Points : 1 |
Yes Very True Nice Example Given by you thanks
== Thanks and Regards Meetu Choudhary - http://www.dotnetspider.com/sites/20/-Learn-ASP-Net.aspx http://www.dotnetspider.com/sites/21/-DotNet-Expertise.aspx
|
| Author: lingesh 20 Oct 2008 | Member Level: Silver Points : 1 |
Anybody know about the static constructors? does it only declared in static classes or normal classes?
|