CPP MCQ PART – 6



PAGES: 1     2     3     4     6     7 


101. The following operators cannot be overloaded
a) scope resolution operator
b) size of operator
c) conditional operator
d) all of the above

102. The operator definition precedes with the keyword class
a) class
b) operator
c) overload
d) none of the above

103. The operator function
a) is declared in the public section of the class
b) may be a member function or a friend function
c) both (a) & (b)
d) none of the above

104. The operator functions may be invoked
a) implicitly
b) explicitly
c) both (a) & (b)
d) none of the above

105. The following operator can’t be overloaded
a) unary
b) binary
c) ternary
d) none of the above

106. Which of the following statements regarding operator overloading function is false?
a) While overloading, the semantics of an operator cannot be changed.
b) The operator precedence cannot be changed while overloading.
c) The overloaded operator must have at least one operand that is of user-defined type.
d) You can create new operator symbol.

107. The following operators cannot be overloaded.
a) Logical AND (&&)
b) Subscript operator ([])
c) Equality operator (==)
d) none of the above

108. A unary operator when overloaded takes
a) no operand
b) one operand
c) two operands
d) none of the above]

109. The no of arguments required when overloading through friend functions is
a) Zero
b) One
c) Two
d) None of the above

110. Which of the following statements regarding operator overloading is false?
a) friend function cannot be used to overload certain operators.
b) Unary operators overloaded by means of friend functions takes no argument
c) Binary operators must explicitly return a value
d) The syntax rules of the operators cannot be overridden.

111. The following feature supports extensibility and reusability of classes
a) function overloading
b) inheritance
c) operator overloading
d) data encapsulation

112. The process of deriving a class from another derived class is
a) single inheritance
b) multilevel inheritance
c) multiple inheritance
d) none of the above

113. When a derived class inherits only from one class and is not further inherited is
a) single inheritance
b) multiple inheritance
c) multilevel inheritance
d) hybrid inheritance

114. When a derived class inherits from may base classes it is
a) multilevel inheritance
b) single inheritance
c) multiple inheritance
d) none of the above

115. Inheritance is ……….. in nature
a) transitive
b) intransitive
c) both (a) & (b)
d) none of the above

116. ……………. variables cannot be declared
a) structure
b) pointer
c) void
d) class

117. When a subclass inherits from multiple base classes, which inherits from a single class, the inheritance type is
a) single inheritance
b) hybrid inheritance
c) multilevel inheritance
d) multiple inheritance

118. When one class inherits from the base class, then the original class is called
a) base class
b) derived class
c) sub class
d) none of the above

119. The default visibility mode while inheriting is
a) private
b) public
c) protected
d) none of the above

120. The class intended to be a base class should use visibility mode as
a) public
b) protected
c) private
d) Both (a) & (b)

121. Operator overloading is
a) making c++ operators work with objects
b) giving c++ operators more than they can handle
c) giving new meaning to existing c++ operators
d) making new c++ operators

122. To convert from a user defined class to a basic type, you would most likely use
a) a built-in conversion function
b) a one-argument constructor
c) an overloaded-operator
d) a conversion function that’s member of the class

123. The members of a class
a) by default are public
b) by default are private
c) are made private by declaring as private
d) none of the above]

124. The following symbol indicates the derived class is derived from the base class
a) ::
b) :
c) ->
d) none of the above

125. When a base class publicly inherited
a) the public members of the base class are inherited as private
b) the private members are inherited as private
c) the protected members are inherited as protected
d) none of the above

CHECK ANSWERS


PAGES: 1     2     3     4     6     7