Question: C++ requires that a derived class constructor calls its base class constructor if the base class has no default constructor. This is because Question 1
C++ requires that a derived class constructor calls its base class constructor if the base class has no default constructor. This is because
Question 1 options:
| if there is no default constructor in the base class and the derived class does not call a base class constructor, a random base class constructor will be executed. | |
| if there is no default constructor in the base class and the derived class does not call a base class constructor, no base class constructor will be executed. | |
| if there is no default constructor in the base class and the derived class does not call a base class constructor, the compiler will not be able to create a default constructor for the base class. | |
| if there is no default constructor in the base class and the derived class does not call a base class constructor, the compiler will select the first defined base class constructor to execute which may not be what the programmer wants. |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
