Python
# Program to simulate method overloading
class Adder:
def add(self, *args):
return sum(args)
a = Adder()
print(a.add(1, 2))
print(a.add(1, 2, 3))Output
3 6
Python does not support true method overloading, but *args lets one method handle varying numbers of arguments.