In this article,Method overloading is explained in detail with examples.
Two or more methods in a single class with same name and atleast one difference in the signature is known as method loading.
Signature means a number of arguments, the order of arguments and data type of arguments.
Ex
class A
{
---Data members---;
---Constructors----;
void m1(int,int){---}
void m1(float,float){---}
void m1(int,float){---}
void m1(float,int){---}
Two or more methods in a single class with same name and atleast one difference in the signature is known as method loading.
Signature means a number of arguments, the order of arguments and data type of arguments.
Ex
class A
{
---Data members---;
---Constructors----;
void m1(int,int){---}
void m1(float,float){---}
void m1(int,float){---}
void m1(float,int){---}