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
- By changing number of arguments
- By changing the data type