G
GeezerButler
We have 2 classes. Class B derives from A
//Has 2 constructors
public class A
{
A()
{
//do something
}
A(string name)
{
//do something
}
}
//and B has 3 constructors
public class B : A
{
B()
{
//do something
}
B(int age)
{
//do something
}
B(string name, int age)
{
//do something
}
}
In the third contructor of B, i want to call base(name) and also
this(age).
i.e. B(string name, int age) : base(name) works
B(string name, int age) : this(age) works
but B(string name, int age) : this(age) , base(name) does not work
Is it possible to do this in some way?
//Has 2 constructors
public class A
{
A()
{
//do something
}
A(string name)
{
//do something
}
}
//and B has 3 constructors
public class B : A
{
B()
{
//do something
}
B(int age)
{
//do something
}
B(string name, int age)
{
//do something
}
}
In the third contructor of B, i want to call base(name) and also
this(age).
i.e. B(string name, int age) : base(name) works
B(string name, int age) : this(age) works
but B(string name, int age) : this(age) , base(name) does not work
Is it possible to do this in some way?