Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
method overloading
1. 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?
2. 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:
3. 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?
4. Method Overloading is:
Same Method Name
In the same class
And
Different Parameter types
Summary of this presentation:
5. Thank you for being with me
Specially Thank to Honorable
Course Instructor