Ch.15 Inheritance, Polymorphism, and Virtual Functions Flashcards
A derived class inherits the ________ of its base class.
Member
When both a base class and a derived class have constructors, the base class’s instructor is called _________ (first, last).
First
When both a base class and a derived class have destructors, the base class instructor is called _________ (first, last).
Last
An overridden base class function may be called by a function in a derived class by using the ________ operator.
scope resolution : :
When a derived class redefines a function in a base class, which version of the function do objects that are defined of the base class call? ________
base class
A(n) _______ member function in a base class expects to be overwritten in a derived class.
Virtual
________ binding is when the compiler binds member function calls at compile time.
static
_______ binding is when a function call is bound at run time.
Dynamic
________ is when member functions in a class hierarchy behave differently, depending on which object performs the call.
Polymorphism
When a pointer to a base class is made to point to a derived class, the pointer ignores any ________ the derived class performs, unless the function is ________.
Overriding, Virtual
A ________ class cannot be instantiated.
Abstract Base
A _____ function has no body, or definition, in the class in which it is declared.
Pure Virtual
A ________ of inheritance is where one class is derived from a second class, which in turn is derived from a third class.
Chain
_______ is where a derived class has two or more base classes.
Multiple Inheritance
In multiple inheritance, the derived class should always _______ a function that has the same name in more than one base class.
Override
The base class’s access specification affects the way base class member functions may access base class member variables. T/F
False
The base class’s access specification affects the way the derived class inherits members of the base class. T/F
True
Private members of a private base class become inaccessible to the derived class. T/F
True
Public members of a private base class become private members of the derived class. T/F
True
Protected members of a private base class become public members of the derived class. T/F
False
Public members of a protected base class become private members of the derived class. T/F
False
Private members of a protected base class become inaccessible to the derived class. T/F
True
Protected members of a public base class become public members of the derived class. T/F
False
The base class constructor is called after the derived class constructor. T/F
False
The base class destructor is called after the derived class destructor. T/F
True
It isn’t possible for a base class to have more than one constructor. T/F
False
Arguments are passed to the base class constructor by the derived class constructor. T/F
True
A member function of a derived class may not have the same name as a member function of the base class. T/F
False
Pointers to a base class may be assigned the address of a derived class object. T/F
True
A base class may not be derived from another class. T/F
False