Python Programming - Polymorphism - Discussion

Discussion Forum : Polymorphism - General Questions (Q.No. 12)
12.
Which of the following is an example of operator overloading?
Defining a method with the same name in a class
Defining a method with the same name but different parameters in a class
Defining a method with the same name but different return types in a class
Defining the __add__() method in a class
Answer: Option
Explanation:
Operator overloading in Python involves defining methods like __add__() to provide custom behavior for operators.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.