Hi friends,
I want to know that If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor?
Overloaded constructor in c#
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


VulpesRank #55 · 29.2K reputationPosted Jan 17, 2012, 12:57 PM EST
class Parent
{
public Parent(string s)
{
// code
}
public Parent()
{
// code
}
}
class Child :Parent
{
public Child(string s) : base()
{
// code
}
public Child() : base("Hello")
{
// parent
}
}
Here, the Child class's constructors force calls to specific overloads of the Parent class's constructors.