CS ch 15

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

In an inheritance situation, the new class that you create from an existing class is known as the ________. derived class inheritor child class derived class and child class None of these

derived class and child class

The ________ destructor is called before the ________ destructor. base, derived derived, base public, private private, public None of these

derived, base

Multiple inheritance is when a ________ class has ________ base classes. base, no derived, two or more derived, no compound, more than two None of these

derived, two or more

Multiple inheritance opens the opportunity for a derived class to have ________ members. dynamic private public ambiguous None of these

dynamic private public ambiguous None of these

The compiler performs ________ on virtual functions. static binding dynamic binding additional error checking no special services None of these

dynamic binding

True/False: A derived class may not have any classes derived from it. true false

false

True/False: A member function of a derived class may not have the same name as a member function of a base class. true false

false

True/False: In an inheritance situation, you may not pass arguments to a base class constructor. true false

false

When member functions behave differently, depending upon which object performed the call, this is an example of ________. chaos theory virtual insubordination polymorphism encapsulation None of these

polymorphism

In the following statement: class Car : protected Vehicle ________ is the derived class. Car Vehicle protected Cannot be determined None of these

Car

________ allows us to create new classes based on existing classes. Polymorphism Inheritance Function overloading The copy constructor None of these

Inheritance

________ is commonly used to extend a class, or to give it additional capabilities. Inheritance Privacy The constructor The destructor None of these

Inheritance

Arguments are passed to the base class destructor function by the ________ class ________ function. derived, constructor derived, destructor base, constructor base, destructor None of these

None of these

The following statement: class Car : private Vehicle allows the ________ members of the Car class to access ________ members of the Vehicle class. private, private public, private protected, private public, protected None of these

None of these

When more than one class is derived from a base class, the situation is called: polymorphism population multiplicity encapsulation None of these

None of these

________ to a base class may be assigned the address of a derived class object. Access specifiers Static members Private members Pointers None of these

Pointers

________ functions are dynamically bound by the compiler. Constructor Destructor Static Virtual None of these

Virtual

The base class's ________ affects the way its members are inherited by the derived class. name return data type access specification name and return data type None of these

access specification

In the following statement: class car: protected vehicle What is being protected? derived class functions base class members derived class data future inherited classes None of these

base class members

The ________ constructor is called before the ________ constructor. base, derived derived, base public, private private, public None of these

base, derived

When you derive a class from an existing class, you ________ add new data and functions. never must may None of these

may

Polymorphism is when ________ in a class hierarchy perform differently, depending upon which object performs the call. base class constructors derived class destructors member functions derived class constructors None of these

member functions

When a derived class has two or more base classes, the situation is known as ________. multiple inheritance polymorphism encapsulation access specification None of these

multiple inheritance

A virtual function is a member function that expects to be ________ in a derived class. ignored called frequently overridden private None of these

overridden

C++ 11 introduces the ________ key word to help prevent subtle errors when overriding virtual functions. const final override virtual None of these

override

The term ________ means the ability to take many forms. inheritance polymorphism member function encapsulation None of these

polymorphism

________ members of a base class are never accessible to a derived class. Public Private Protected Public, Private, and Protected None of these

private

Protected members of a base class are like ________, but they may be accessed by derived classes. constructor functions static members private members public members None of these

private members

The base class access specification determines how ________ members in the base class may be accessed by derived classes. private public protected private, public, and protected None of these

private, public, and protected

When the compiler binds a member function call with the version of the function that resides in the same class as the call itself, this is considered ________ binding. local safe static dynamic None of these

static

True/False: A derived class may become a base class, if another class is derived from it. true false

true

True/False: In C++ 11, if a derived class attempts to override a final member function, the compiler generates an error. true false

true

True/False: More than one class may be derived from a base class. true false

true

True/False: Pointers to a base class may be assigned the address of a derived class object. true false

true

True/False: Static binding occurs when the compiler binds a function call with the function call that resides in the same class as the call itself. true false

true

True/False: The base class access specification can be viewed as a filter that base class members must pass through when becoming inherited members of a derived class. true false

true

True/False: When arguments must be passed to the base class constructor, they are passed from the derived class constructor's header line. true false

true

In the following statement: class car : public vehicle ________ is the base class. car vehicle public class None of these

vehicle

A virtual function is declared by placing the key word ________ in front of the return type in the base class's function declaration. virtual private public protected None of these

virtual

A ________ of a base class expects to be overridden in a derived class. constructor function destructor function static function virtual function None of these

virtual function


Ensembles d'études connexes

Unit 12 body system 4:The Male Reproductive System

View Set

Chapter 9 Class Test - Legal Descriptions

View Set

Chapter 22 - Performance and Breach of Sales and Lease Contracts

View Set

Business 150 Module 3 Study Guide

View Set

Chapter 20 Biology, Chapter 21 Biology, Chapter 22 Biology

View Set

GOVT 2306 Chapter 3 Review: The Texas Legislature

View Set

Psychology201 maintain memories over time

View Set