Is it possible to call the base Constructor at spicific point in the constructer of the subclass like:
public class SuperClass
{
public SuperClass(Object myObject)
{
// init some values ...
}
}
public class SubClass: SuperClass
{
public SubClass(): base(Object myObject)
{
//Check some preconditions
base(myObject);
// Do some other stuff
}
}
No, it’s not possible.
One way to achieve this behavior you could extract the contents of the base constructor out into a method and then call that method from the subclass.
Another less closely tied method would be to just not use inheritance here. It’s possible that this is a situation in which composition would make more sense. (It’s impossible to say for sure without knowing more information though.)