A) Class A is a friend of class C.
B) Class A can access private variables of class B.
C) Class C can call class A's private member functions.
D) Class B can access class A's private variables.
Correct Answer
verified
Multiple Choice
A) A non-reference, non-const, primitive data member is initialized in the member initialization list.
B) An object data member is not initialized in the member initialization list.
C) An object data member does not have a default constructor.
D) An object data member is not initialized in the member initialization list and does not have a default constructor.
Correct Answer
verified
Multiple Choice
A) I, II and III.
B) I and II.
C) I and III.
D) II and III.
Correct Answer
verified
Multiple Choice
A) The host object is constructed first and then the member objects are placed into it.
B) Member objects are constructed first, in the order they appear in the host constructor's initializer list.
C) Member objects are constructed first, in the order they are declared in the host's class.
D) Member objects are destructed last, in the order they are declared in the host's class.
Correct Answer
verified
Multiple Choice
A) t.a) .b) .d) ;
B) a) .b) .t;
C) t.d) .c) ;
D) t.a) .t.d) ;
Correct Answer
verified
Multiple Choice
A) Can be accessed only if an object of that class exists.
B) Cannot be changed, even by objects of the same that class.
C) Have class scope.
D) Can only be changed by static member functions.
Correct Answer
verified
Multiple Choice
A) 3
B) 7
C) 9
D) 4
Correct Answer
verified
Multiple Choice
A) A class can either grant friendship to or take friendship from another class using the friend keyword.
B) A friend declaration can appear anywhere in a class definition.
C) A friend of a class can access all of its private data member and member functions.
D) The friendship relationship is neither symmetric nor transitive.
Correct Answer
verified
Multiple Choice
A) count must be a non-const variable.
B) count must be a const variable.
C) increment must be a non-const variable.
D) increment must be a const variable.
Correct Answer
verified
Multiple Choice
A) Can use the this pointer.
B) Can access only other static member functions and static data members.
C) Cannot be called until an object of their class is instantiated.
D) Can be declared const as well.
Correct Answer
verified
Multiple Choice
A) An int.
B) A user-defined class.
C) A for loop.
D) None of the above are abstract data types.
Correct Answer
verified
Multiple Choice
A) const Test *
B) Test * const
C) Test const *
D) const Test * const
Correct Answer
verified
Multiple Choice
A) Age.
B) The President.
C) Place of birth.
D) Favorite food.
Correct Answer
verified
Multiple Choice
A) *this.x
B) *this) .x
C) x
D) * & *this) ) ) .x
Correct Answer
verified
Multiple Choice
A) Defining a const member function that modifies a data member of the object.
B) Invoking a non-const member function on a const object.
C) Declaring an object to be const.
D) Declaring a constructor to be const.
Correct Answer
verified
Showing 1 - 15 of 15
Related Exams