Method overloading in java

Method overloading
A class have two or more methods by same name but different signature (parameters), it is known as Method Overloading.
If we have to perform only one operation, having same name of the methods increases the readability of the program.

Ways to overload the method:
There are two ways to overload the method in java

  1. By changing number of arguments
  2. By changing the data type

Leave a Reply

Your email address will not be published. Required fields are marked *