C++ requires that a derived class constructor calls its base class constructor i
ID: 3907405 • Letter: C
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 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.
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.
Explanation / Answer
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.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.