Sudeep Kumar Das

What is method overloading?


Explanation

1124    0

If a class, has multiple methods having same name but different in parameters, it is known as Method Overloading.

Method overloading is a form of polymorphism in OOP. Polymorphism allows objects or methods to act in different ways, according to the means in which they are used. One such manner in which the methods behave according to their argument types and number of arguments is method overloading.

For example: 

Here, the func() method is overloaded. These methods have the same name but accept different arguments.




Share:   

More Questions from Module 0