Multiple Choice Questions in C++ (Set-XIV)

Multiple Choice Questions in C++




Multiple choice questions in C++ (With answers)

131. When an object of a derived class is created
a) derived class constructor is called followed by base class constructor
b) base class constructor is called followed by derived class constructor
c) base class constructor is not called at all
d) none of the above

132. The derived class constructor
a) never passes any values to base class constructor
b) is responsible for passing the entire test of arguments needed by base class constructors
c) can pass arguments only to one base class constructor function
d) none of the above

133. A virtual base class
a) allows to inherit more than one copy of the base class members
b) strict the path of inheritance
c) is qualified as virtual in base class definition
d) none of the above

134. When a base class is inherited publicly
a) the private members of the base class are not accessible
b) the derived class can directly access the private members of the base class
c) the derived class can access the private members only through the member function of the base class
d) none of the above

135. When two or more classes are used within another class definition, it is
a) inheritance
b) aggregation
c) both (a) & (b)
d) none of the above

136. Composition is referred to as
a) “is a” relationship
b) “has a” relationship
c) both (a) & (b)
d) none of the above

137. Inheritance is referred to as
a) “is a” relationship
b) “has a” relationship
c) Both (a) & (b)
d) none of the above

138. An explicitly defined destructor function
a) may be virtual
b) may not be virtual
c) both (a) & (b)
d) None of the above

139. The copy operation by a simple assignment causes in some cases
a) no effect
b) hollow copy
c) copy exactly the same as original
d) creates new

140. Public data members can be accessed
a) only from the base class itself
b) both form the base class and from its derived class
c) from the class which is a friend of the base class
d) none of the above




Solution Set to Multiple Choice Questions

(131)      B          (132)      B

(133)      C          (134)      C          (135)      B          (136)      B

(137)      A          (138)      A          (139)      B          (140)      C



You cannot copy content of this page.