SlideShare a Scribd company logo
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

More Related Content

PPTX
Algorithm and complexity
PPT
M C6java4
PDF
A Supervised Machine Learning Algorithm for Research Articles
PPTX
Array & Exception Handling in C# (CSharp)
PPTX
Local variables Instance variables Class/static variables
PPTX
AWT Packages , Containers and Components
PPTX
File Handling
PPTX
Java class,object,method introduction
Algorithm and complexity
M C6java4
A Supervised Machine Learning Algorithm for Research Articles
Array & Exception Handling in C# (CSharp)
Local variables Instance variables Class/static variables
AWT Packages , Containers and Components
File Handling
Java class,object,method introduction

Recently uploaded (20)

PPTX
Pharma ospi slides which help in ospi learning
PPTX
master seminar digital applications in india
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Complications of Minimal Access Surgery at WLH
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Classroom Observation Tools for Teachers
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Institutional Correction lecture only . . .
PDF
Basic Mud Logging Guide for educational purpose
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Lesson notes of climatology university.
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Computing-Curriculum for Schools in Ghana
PDF
RMMM.pdf make it easy to upload and study
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
Pharma ospi slides which help in ospi learning
master seminar digital applications in india
Microbial disease of the cardiovascular and lymphatic systems
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Complications of Minimal Access Surgery at WLH
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Classroom Observation Tools for Teachers
Abdominal Access Techniques with Prof. Dr. R K Mishra
Institutional Correction lecture only . . .
Basic Mud Logging Guide for educational purpose
Supply Chain Operations Speaking Notes -ICLT Program
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Lesson notes of climatology university.
Renaissance Architecture: A Journey from Faith to Humanism
Computing-Curriculum for Schools in Ghana
RMMM.pdf make it easy to upload and study
O5-L3 Freight Transport Ops (International) V1.pdf
Ad
Ad

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