Ch.15 Inheritance, Polymorphism, and Virtual Functions Flashcards

1
Q

A derived class inherits the ________ of its base class.

A

Member

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When both a base class and a derived class have constructors, the base class’s instructor is called _________ (first, last).

A

First

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When both a base class and a derived class have destructors, the base class instructor is called _________ (first, last).

A

Last

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

An overridden base class function may be called by a function in a derived class by using the ________ operator.

A

scope resolution : :

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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? ________

A

base class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A(n) _______ member function in a base class expects to be overwritten in a derived class.

A

Virtual

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

________ binding is when the compiler binds member function calls at compile time.

A

static

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

_______ binding is when a function call is bound at run time.

A

Dynamic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

________ is when member functions in a class hierarchy behave differently, depending on which object performs the call.

A

Polymorphism

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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 ________.

A

Overriding, Virtual

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A ________ class cannot be instantiated.

A

Abstract Base

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A _____ function has no body, or definition, in the class in which it is declared.

A

Pure Virtual

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A ________ of inheritance is where one class is derived from a second class, which in turn is derived from a third class.

A

Chain

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

_______ is where a derived class has two or more base classes.

A

Multiple Inheritance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In multiple inheritance, the derived class should always _______ a function that has the same name in more than one base class.

A

Override

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The base class’s access specification affects the way base class member functions may access base class member variables. T/F

A

False

17
Q

The base class’s access specification affects the way the derived class inherits members of the base class. T/F

A

True

18
Q

Private members of a private base class become inaccessible to the derived class. T/F

A

True

19
Q

Public members of a private base class become private members of the derived class. T/F

A

True

20
Q

Protected members of a private base class become public members of the derived class. T/F

A

False

21
Q

Public members of a protected base class become private members of the derived class. T/F

A

False

22
Q

Private members of a protected base class become inaccessible to the derived class. T/F

A

True

23
Q

Protected members of a public base class become public members of the derived class. T/F

A

False

24
Q

The base class constructor is called after the derived class constructor. T/F

A

False

25
Q

The base class destructor is called after the derived class destructor. T/F

A

True

26
Q

It isn’t possible for a base class to have more than one constructor. T/F

A

False

27
Q

Arguments are passed to the base class constructor by the derived class constructor. T/F

A

True

28
Q

A member function of a derived class may not have the same name as a member function of the base class. T/F

A

False

29
Q

Pointers to a base class may be assigned the address of a derived class object. T/F

A

True

30
Q

A base class may not be derived from another class. T/F

A

False