Filters
Question type

Study Flashcards

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.

A) True
B) False

Correct Answer

verifed

verified

In an inheritance situation, you can't pass arguments to a base class constructor.

A) True
B) False

Correct Answer

verifed

verified

You can overload the conditional operator to make it function as an unconditional operator.

A) True
B) False

Correct Answer

verifed

verified

To dereference an object pointer and access one of the object's members, use the


A) -> operator.
B) <> operator.
C) dot operator.
D) & operator.
E) None of the above

F) All of the above
G) C) and D)

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

When a class declares an entire class as its friend, the friendship status is reciprocal. That is, each class's member functions have free access to the other's private members.

A) True
B) False

Correct Answer

verifed

verified

A static member function can be called independently of any object of the class.

A) True
B) False

Correct Answer

verifed

verified

C++ allows you to overload


A) compiler errors.
B) preprocessor directives.
C) operators and functions.
D) undefined variables.
E) None of the above

F) D) and E)
G) A) and B)

Correct Answer

verifed

verified

C++ requires that a copy constructor's parameter be


A) an integer data type.
B) a floating-point data type.
C) a pointer variable.
D) a reference to an object.
E) None of the above

F) A) and B)
G) A) and E)

Correct Answer

verifed

verified

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


A) Public
B) Private
C) Protected
D) A, B, and C
E) None of the above

F) C) and D)
G) C) and E)

Correct Answer

verifed

verified

If a function f is a friend of a class A, and the class A is a friend of a class B, then the function f is able to access private members of B.

A) True
B) False

Correct Answer

verifed

verified

Each object of a class has its own copy of the class's


A) static member variables.
B) instance member variables.
C) static member functions.
D) All of the above
E) None of the above

F) A) and E)
G) A) and B)

Correct Answer

verifed

verified

The process of having a class contain an instance of another class is known as


A) object overloading.
B) operator overloading.
C) object composition.
D) dynamic composition.
E) None of the above

F) A) and B)
G) C) and E)

Correct Answer

verifed

verified

An rvalue is


A) a temporary value that cannot be accessed from a different part of the program.
B) the right operand of a binary operator.
C) a value passed as the rightmost parameter of a function.
D) a memory location that is associated with a name that can be used by different parts of the program to access the memory location.
E) None of the above

F) D) and E)
G) B) and E)

Correct Answer

verifed

verified

A base class cannot contain a pointer to one of its derived classes.

A) True
B) False

Correct Answer

verifed

verified

If you do not furnish a(n) ________, an automatic memberwise copy will be performed when one object is assigned to another object.


A) overloaded constructor function
B) overloaded assignment operator
C) default constructor function
D) overloaded copy operator
E) None of the above

F) B) and C)
G) A) and C)

Correct Answer

verifed

verified

If an rvalue reference refers to a memory location, that memory location becomes an lvalue.

A) True
B) False

Correct Answer

verifed

verified

When you overload the << operator, you must also overload the >> operator.

A) True
B) False

Correct Answer

verifed

verified

In C++, if you overload the < operator, you must also overload the > operator.

A) True
B) False

Correct Answer

verifed

verified

The ________ class destructor is called before the ________ class destructor.


A) base, derived
B) derived, base
C) public, private
D) private, public
E) None of the above

F) A) and B)
G) A) and C)

Correct Answer

verifed

verified

Showing 41 - 60 of 70

Related Exams

Show Answer