What is Method Overloading? In how many ways a method can be overloaded?

Method overloading is a type of polymorphism in which we can create multiple methods of the same name in the same class, and all methods work in different ways.

Overloading happens when you have two methods with the same name but different signatures (or arguments). In a class we can implement two or more methods with the same name. Overloaded methods are differentiated based on the number and type of parameter passed as arguments to the methods.


Post a Comment

Previous Post Next Post