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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started