Exam 3 (chapter 15, part of chapter 16)

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

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

False

In an inheritance situation, the new class that you create from an existing class is known as the ________.

derived class and child class

The ________ destructor is called before the ________ destructor.

derived, base

Multiple inheritance is when a ________ class has ________ base classes.

derived, two or more

The compiler performs ________ on virtual functions

dynamic binding

When member functions behave differently, depending upon which object performed the call, this is an example of ________.

polymorphism

In the following statement: class car : protected vehicle ________ is the derived class.

Car

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

False

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

False

________ is commonly used to extend a class, or to give it additional capabilities.

Inheritance

Arguments are passed to the base class destructor function by the ________ class ________ function. (a)derived, constructor (b)derived, destructor (c)base, constructor (d)base, destructor (e)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. (a) private, private (b) public, private (c) protected, private (d) public, protected (e) None of these

None of these

When more than one class is derived from a base class, the situation is called: (a)polymorphism (b)population (c)multiplicity (d)encapsulation (e)None of these

None of these

______ to a base class may be assigned the address of a derived class object.

Pointers

_______ members of a base class are never accessible to a derived class.

Private

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

True

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

True

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

True

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

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

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

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

True

________ functions are dynamically bound by the compiler.

Virtual

A ________ of a base class expects to be overridden in a derived class.

Virtual Function

The base class's ________ affects the way its members are inherited by the derived class.

access specification

Multiple inheritance opens the opportunity for a derived class to have ________ members.

ambiguous

In the following statement: class car : protected vehicle What is being protected?

base class members

The ________ constructor is called before the ________ constructor.

base, derived

_______ allows us to create new classes based on existing classes.

inheritance

When you derive a class from an existing class, you ________ add new data and functions.

may

Polymorphism is when ________ in a class hierarchy perform differently, depending upon which object performs the call.

member functions

When a derived class has two or more base classes, the situation is known as ________.

multiple inheritance

A virtual function is a member function that expects to be ________ in a derived class.

overridden

C++ 11 introduces the ________ key word to help prevent subtle errors when overriding virtual functions.

override

The term ________ means the ability to take many forms.

polymorphism

Protected members of a base class are like ________, but they may be accessed by derived classes.

private members

The base class access specification determines how ________ members in the base class may be accessed by derived classes.

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.

static

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

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


संबंधित स्टडी सेट्स

Chapter 11 Section 3: The War at Home

View Set

Ap European History: Chapter 16 Scientific Revolution Vocab

View Set

Chapter 18- Personality Disorders

View Set

Ch. 12 - Substance-Related and Addictive Disorders

View Set

Bus Mgmt Ch 10 Managing the Forms of Business Ownership

View Set

Prin. of Biology II Lecture Exam

View Set

honors world history - vocab unit one

View Set

Nursing care of the child with an alteration in tissues integrity/Integumentary disorder

View Set

Nonrenewable Energy Resources & Consumption

View Set

Intro to Art UNIT 9: INTRO TO ART HISTORY: ANCIENT ART IN DIFFERENT CULTURES (Time4Learning)

View Set