Question 1: Without considering the access attributes, list and describe which b
ID: 3557786 • Letter: Q
Question
Question 1: Without considering the access attributes, list and describe which base class members may not be inherited by a derived class and provide a rationale for why this is.
Question 2: If a class is derived protected from a base class, explain how this affects the inheritance of all public, protected, and private members of the base class by the derived class.
Question 3: Describe what a namespace is and provide general syntax of a namespace statement.
Question 1: Without considering the access attributes, list and describe which base class members may not be inherited by a derived class and provide a rationale for why this is.
Explanation / Answer
1)Private members are not inherited
Constructors, destructors, static members also not inherited. After all they are the class specific.
reason
the Derived class inherits from the Base class, both the Base class and Derived class constructors will be called when a Derived class object is created.
2)
Protected inheritance
3)
A namespace declaration identifies and assigns a unique name to a user-declared namespace.
The syntax for a namespace definition is:
example
Protected inheritance
Base access specifier Derived access specifier Derived class access? Public access? Public Protected Yes No Private Private No No Protected Protected Yes NoRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.