Which of the following statements about inheriting base class constructors is false?
a. To inherit a base class’s constructors, you write the following line of code in the derived class definition (BaseClass is the base class’s name):
using BaseClass::BaseClass;
b. If an inherited base-class constructor has default arguments, the line of code in Part (a) causes the compiler to generate a derived-class constructor with the same default arguments.
c. By default, each inherited constructor has the same access level (public, protected or private) as its corresponding base-class constructor.
d. If the derived class does not explicitly define constructors, the compiler generates a default constructor in the derived class—even if it inherits other constructors from its base class.
b. If an inherited base-class constructor has default arguments, the line of code in Part (a) causes the compiler to generate a derived-class constructor with the same default arguments.
If an inherited base-class constructor has default arguments, the line of code in Part (a) causes the compiler to generate a derived-class constructor with the same default arguments. (A base-class constructor’s default arguments are not inherited. Instead, the compiler generates overloaded constructors without default arguments in the derived class.)
You might also like to view...
The ________ document is the document that contains the text and formatting that remains constant across all letters or labels
Fill in the blank(s) with correct word
Provide some examples of ethically questionable business decisions that have recently been in the news.
What will be an ideal response?