To overload a method we must keep some difference in their arguments. The difference in the arguments can be either in their numbers, orders or datatypes. For example, we can have two methods with the name sum(), first with two integer arguments and second with three arguments. If the arguments are same in number, datatype or order the compiler will throw an ambiguity error which will mean that it is not able to differentitate one method with the other.
Example:
void sum(int);
void sum(int,int);
void sum(double, int);