I don't understand. What should I do to avoid the execution of constructor base class by creating derived class? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I don't understand. What should I do to avoid the execution of constructor base class by creating derived class?

22nd Apr 2016, 9:02 AM
ShaminIlya
4 Answers
+ 1
You don't have to. Just leave the base class's constructor blank as default.
29th Apr 2016, 12:28 AM
zhiyuan zheng
zhiyuan zheng - avatar
+ 1
I believe constructor overloading would give you a choice on which constructor to use when creating an instance of a derived class. Or you could leave the constructor implementation explicitly to the derived classes and leave the base Class' constructor blank, as Zhiyuan stated.
15th Jun 2016, 12:11 AM
Malachi Jones
Malachi Jones - avatar
0
constructor run every time u call class and the first thing run on the class it is.
27th Jun 2016, 10:33 AM
Artemis Ariamehr
Artemis Ariamehr - avatar
0
you dont have to create a construtor
15th Dec 2016, 3:43 PM
Mike Daviss
Mike Daviss - avatar