G
Greg
Hi,
I have a class that has 3 different constructors in it. In the base
constructor I want to have it set some default data. I don't want to
have the overloaded constructors do these same operations (event to
the extent of creating a function that each constructor calls).
Is it possible to ensure that the base constructor always gets called
when one of the overloaded constructors gets called?
i.e.
public myclass {
public myclass() {
//Set something
}
public myclass(string input) {
//Do some other stuff while knowing that the first constructor has
already executed.
}
Is this the only way to do this to create the first constructor as a
base class on it's own and inherit the constructor from it?
Thanks - Greg.
}
I have a class that has 3 different constructors in it. In the base
constructor I want to have it set some default data. I don't want to
have the overloaded constructors do these same operations (event to
the extent of creating a function that each constructor calls).
Is it possible to ensure that the base constructor always gets called
when one of the overloaded constructors gets called?
i.e.
public myclass {
public myclass() {
//Set something
}
public myclass(string input) {
//Do some other stuff while knowing that the first constructor has
already executed.
}
Is this the only way to do this to create the first constructor as a
base class on it's own and inherit the constructor from it?
Thanks - Greg.
}