Test 3 Multiple Choice

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

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

may

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

member functions

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

private public protected

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

access specification

The ________ destructor is called before the ________ destructor.

base, derived

The try block is immediately followed by one or more ________.

catch blocks

The compiler performs ______ on virtual functions.

dynamic binding

Catch blocks serve as ________.

exception handlers

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

multiple inheritance

These are used to signal errors or unexpected events that occur while a program is running.

Exceptions

True/False: The try/catch/throw construct is able to handle only one type of exception thrown within the scope of a try block.

False

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

overridden

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

private members

When an error occurs, an exception is ________.

thrown

The ________ starts with the key word try, and is followed by a block of code executing any statements that might cause an exception to be thrown.

try block

To handle an exception that has been thrown, a program must have a(n) ________.

try/catch construct

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

Inheritance

Arguments are passed to the base class destructor function by the ________ class ________ function.

None of these - A destructor has no argument

The ________ constructor is called before the ________ constructor.

base, derived

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

none of these

________ members of a base class are never accessible to a derived class (Assuming the derived class is not a friend class of the base class).

private

. 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

An exception thrown from outside a try block ________.

will cause the program to terminate


Kaugnay na mga set ng pag-aaral

Primerica Life Insurance State Exam RI

View Set

Behavior 211 T4 Questions from Varc ch 22/Sims & Saunders

View Set

Transcription and Translation Test - Genetics

View Set

Concept Synthesis: Liver Disease

View Set

UTI and STD Drug Therapy (Exam Style)

View Set