Which of the following denotes advantages of operator overloading ?

  1. Extensibility

  2. Operator not limited to operate only with primitive Data Type

  3. Both A and B

  4. Operator's Scope is increased


Correct Option: C

AI Explanation

To answer this question, we need to understand the concept of operator overloading and its advantages.

Operator overloading allows us to redefine the behavior of an operator for user-defined types. This means that we can provide a specific implementation for an operator when it is used with our own custom data types.

Now let's go through each option to understand why it is correct or incorrect:

Option A) Extensibility - This option is correct because operator overloading allows us to extend the functionality of existing operators to work with user-defined types. This means that we can define how operators should behave when used with our own classes or structures.

Option B) Operator not limited to operate only with primitive Data Type - This option is correct because operator overloading allows us to use operators with user-defined types, not just with primitive data types. This provides flexibility and allows us to define specific behavior for operators when used with our own data types.

Option C) Both A and B - This option is correct because both extensibility and the ability to use operators with user-defined types are advantages of operator overloading.

Option D) Operator's Scope is increased - This option is incorrect because operator overloading does not increase the scope of operators. It only allows us to define specific behavior for operators when used with our own data types.

Therefore, the correct answer is C) Both A and B.

Find more quizzes: