Chapter 11 Flashcards
True or False:
The private members of a base class can be directly accessed by a derived class.
false
True or False:
A derived class cannot directly access public members of a base class.
False
True or False:
If the derived class does not override a public member function of the base class, you may specify a call to that public member function by using the name of the function and the appropriate parameter list.
True
True or False:
The constructors of a derived class can directly initialize only the public data members inherited from the base class of the derived class.
True
True or False:
A call to the base class’s constructor is specified in the heading of the definition of a derived class constructor.
True
True or False:
The class io is the base class of the C++ istream and ostream.
False
True or False:
A derived class can directly access the protected members of the base class.
True
True or False:
In protected inheritance, public and protected members of the base class become protected members of the derived class.
True
True or False:
If inheritance is private, all members of the base class, including private members, become private members of the derived class.
False
Inheritance is an example of a(n) _______ relationship.
is-a
Classes can create new classes from existing classes. This important feature _________.
encourages code reuse
___________ is a “has-a” relationship.
Composition
Existing classes, from which you create new classes, are called ________ classes.
base
Suppose that bClass is a class. Which of the following statements correctly derives the class dClass from bClass?
class dClass: private bClass
{
//classMembersList
};
Consider the following class definition:
class dClass: private bClass
{
//classMembersList
};
The class dClass is derived from the class bClass using the _______ type of inheritance.
private