How to inherit base constructor?

Asked By 0 points N/A Posted on -
qa-featured

I have a base class in which a bunch of constructors are overloaded.

Another class derived from the base class also has a bunch of overloaded constructors.

How can I enforce a call function from an inherited constructor to an arbitrary base constructor?

SHARE
Best Answer by tariq
Answered By 0 points N/A #92854

How to inherit base constructor?

qa-featured

Just place the colon tract then insert the keyword "base term bottom" inside the constructor in the inherited class.

Best Answer
Best Answer
Answered By 0 points N/A #92855

How to inherit base constructor?

qa-featured

In order to deal with this kind of situation, you will have to inherit your constructors from base class.

In this case, you will be able to restrict your methods from being over-ridden.

I do not think that there are any other ways to handle this except as described here.

  • Put a colon sign after inherited class constructor and specify base class constructor there.

Login/Register to Answer

Related Questions