Filters
Question type

Study Flashcards

This type of function is not a member of a class, but it has access to the private members of the class.


A) static
B) constructor
C) destructor
D) friend
E) None of these

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

Correct Answer

verifed

verified

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


A) member functions
B) member variables
C) constructor and destructor functions
D) All of these
E) None of these

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

Correct Answer

verifed

verified

When objects contain pointers, it is a good idea to create an explicit ________ function.


A) destructor
B) copy constructor
C) static constructor
D) inline constructor
E) None of these

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

Correct Answer

verifed

verified

To overload the + operator, you would write a function named ________.


A) overload +
B) operator +
C) function +
D) operator.overload(+)
E) None of these

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

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

When a class contains an instance of another class, it is known as ________.


A) object overloading
B) operator overloading
C) object composition
D) dynamic composition
E) None of these

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

Correct Answer

verifed

verified

A public data member may be declared a friend of a private function.

A) True
B) False

Correct Answer

verifed

verified

It is possible to declare an entire class as a friend of another class.

A) True
B) False

Correct Answer

verifed

verified

If you do not furnish one of these, 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 these

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

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 variable can be used when there are no objects of the class in existence.

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

A(n) ________ informs the compiler that a class will be declared later in the program.


A) static function
B) private data member
C) forward declaration
D) object conversion
E) None of these

F) All of the above
G) B) and E)

Correct Answer

verifed

verified

When you overload an operator, you cannot change the number of ________ taken by the operator.


A) arguments
B) parameters
C) operations
D) operands
E) None of these

F) C) and D)
G) B) and C)

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

An ________ operator can work with programmer-defined data types.


A) inline
B) unconditional
C) overloaded
D) undefined
E) None of these

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

Correct Answer

verifed

verified

A member function that is declared ________ may not access any non-static data members in the class.


A) private
B) public
C) static
D) inline
E) None of these

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

Correct Answer

verifed

verified

The this pointer is a special built-in pointer that is automatically passed as a hidden argument to all non-static member functions.

A) True
B) False

Correct Answer

verifed

verified

This type of member variable may be accessed before any objects of the class have been created.


A) private
B) public
C) inline
D) static
E) None of these

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

Correct Answer

verifed

verified

When you overload an operator, you can change the operator's original meaning to something entirely different.

A) True
B) False

Correct Answer

verifed

verified

Showing 21 - 40 of 40

Related Exams

Show Answer