If I have a base class that has one constructor, is the only way that that
constructor will get called be by having no constructors in my derived
classes or explicitly calling base() in my derived constructors?
Illustration:
abstract class whatever
{
public whatever()
{
//code here I want to run
}
}
class derivedClass : whatever
{
public derivedClass() : base()
{
}
}
That ":base()" is necessary in this case, correct? I guess what I'm more
looking for is some mechansism that will ensure that code in my base classes
is always executed when a derived object is instantiated. I'm mostly trying
to compensate for a behavioral problem here, fearing that other developers
won't remember to put the ": base()" on their constructors. :-/
TIA,
Josh