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

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

3. 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

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

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

6. 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.

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

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

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

10. 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.

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

12. 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

13. 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

14. 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

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

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

17. 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

18. 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

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

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

21. 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

22. 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

23. 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]

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

25. 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
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: