When a class has two or more methods by same
name but different parameters, it is known as
method overloading. It is different from overriding.
What is Method Overloading?
Public Class Adition
{
int Add (int a, int b)
{
return a+b;
}
int Add (int a, int b, int c)
{
return a+b+c;
}
int Add (double a, double b)
{
return a+b;
}
}
Example of Method Overloading:
Public Class Adition
{
int Add (int a, int b)
{
return a+b;
}
int Add (int a, int b, int c)
{
return a+b+c;
}
int Add (int a, int b)
{
return a+b;
}
}
What Happened if there is same tow Method in a class?
Method Overloading is:
Same Method Name
In the same class
And
Different Parameter types
Summary of this presentation:
Thank you for being with me
Specially Thank to Honorable
Course Instructor

method overloading

  • 1.
    When a classhas two or more methods by same name but different parameters, it is known as method overloading. It is different from overriding. What is Method Overloading?
  • 2.
    Public Class Adition { intAdd (int a, int b) { return a+b; } int Add (int a, int b, int c) { return a+b+c; } int Add (double a, double b) { return a+b; } } Example of Method Overloading:
  • 3.
    Public Class Adition { intAdd (int a, int b) { return a+b; } int Add (int a, int b, int c) { return a+b+c; } int Add (int a, int b) { return a+b; } } What Happened if there is same tow Method in a class?
  • 4.
    Method Overloading is: SameMethod Name In the same class And Different Parameter types Summary of this presentation:
  • 5.
    Thank you forbeing with me Specially Thank to Honorable Course Instructor