in below example , we make an object of A using the Constructor of B Class.
First default constructor of class A called then CLR call default constructor of class B ,then make the object of class A .
public class A
{ public A()
{ Console.WriteLine("A"); }
}
public class B:A
{ public B()
{ Console.WriteLine("B"); }
}
class Program
{ static void Main(string[] args)
{
A ob = new B();
}
}
output
A
B
Note:-Please comment and reply me.
It contain detail about all language and oracle. Checkout stackoverflow profile :- http://stackoverflow.com/users/995197/sushant
Friday, December 24, 2010
Answer of Question : How to call a default constructor inside a default constructor
8:34:00 PM
No comments
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment