Skip to main content

Operator Overloading

1).What is operator overloading in C++?

1) Redefining the behavior of operators for user-defined types
2) Using operators in loops
3) Adding new operators
4) None of the above

2).Which keyword is used for operator overloading?

1) operator
2) overload
3) override
4) None of the above

3).Can all operators be overloaded?

1) No
2) Yes
3) Only arithmetic operators
4) None of the above

4).Which operator cannot be overloaded?

1) .
2) ::
3) sizeof
4) All of the above

5).What is the syntax for overloading an operator?

1) ReturnType operatorSymbol(ParameterList)
2) operator ReturnType Symbol(ParameterList)
3) Symbol operator ReturnType(ParameterList)
4) None of the above

6).Can operator overloading change the precedence of an operator?

1) No
2) Yes
3) Only for arithmetic operators
4) None of the above

7).What is the purpose of operator overloading?

1) To work with user-defined data types
2) To modify operator precedence
3) To improve memory management
4) None of the above

8).Can operator overloading be done for all data types?

1) No, only for user-defined types
2) Yes, for all types
3) Only for primitive types
4) None of the above

9).What is the return type of the overloaded assignment operator?

1) Class reference
2) Void
3) New object
4) None of the above

10).Can the addition operator (+) be overloaded for strings?

1) Yes
2) No
3) Only for integer strings
4) None of the above