SlideShare a Scribd company logo
what is method overloading?
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
Method Overloading
SWALIH T
swalihk321@gmail.com
www.facebook/ swalih321
twitter.com/swalih321
in.linkedin.com/in/swalih321
9539353663
POLYMORPHISM
• Polymorphism means more than one
form, same object performing different
operations according to the requirement.
Types
• Compile time: Overloading.
• Run time: Overriding.
Method Overloading
• Method overloading means writing two are or
more methods in the same class by using same
method name, but passing the parameters is
different.
• Overloading is the practice of supplying more
than one definition for a given method name in
the same class. The compiler will automatically
select the most appropriate one based on the
arguments with which it is called.
Method Overloading
• Overloading is useful to add flexibility to a
method. In general, if you want to create a
method that adds two numbers then it only
take either integer, double, or float but by
overloading, you can add values of all data
types.
Method Overloading
There are two ways to overload the method in
java
o By changing number of arguments
o By changing the data type
o By changing number of arguments
o By changing the data type
Advantages of method overloading
• It allows you to use the same name for a group
of methods that basically have the same purpose.
• It provides an easy way to handle default
parameter value.
• Assume that a method has one required
parameter and two optional parameters. Three
overloaded forms of this method can be defined.
It can accept one, two or three parameters.
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.
Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com

More Related Content

Similar to what is method overloading? (20)

PDF
Method Overloading In Java
PDF
Unit 2 Part 1 POLYMORPHISM.pdf
PPTX
JAVA PPT.pptxmjejsisisiksjsjsjkdkskdnejejje
PPTX
Method overloading
PDF
Web Technology-Method .pdf
PPTX
Method overloading and constructor overloading in java
PPTX
Method Overloading in Java
PPTX
Lecture_7 Method Overloading.pptx
PPT
Method overloading
PPTX
BCA Oveloading and Overriding (2).pptx
PPTX
Polymorphism in java
PPTX
Method overloading in java
PPTX
Overloading and overriding in vb.net
PPTX
Polymorphism in java
PPTX
Method Overloading in Java
PPTX
2CPP11 - Method Overloading
PDF
Polymorphism in Java
PPT
Introduction to method overloading & method overriding in java hdm
Method Overloading In Java
Unit 2 Part 1 POLYMORPHISM.pdf
JAVA PPT.pptxmjejsisisiksjsjsjkdkskdnejejje
Method overloading
Web Technology-Method .pdf
Method overloading and constructor overloading in java
Method Overloading in Java
Lecture_7 Method Overloading.pptx
Method overloading
BCA Oveloading and Overriding (2).pptx
Polymorphism in java
Method overloading in java
Overloading and overriding in vb.net
Polymorphism in java
Method Overloading in Java
2CPP11 - Method Overloading
Polymorphism in Java
Introduction to method overloading & method overriding in java hdm
Ad

More from baabtra.com - No. 1 supplier of quality freshers (20)

PPTX
Agile methodology and scrum development
PDF
Acquiring new skills what you should know
PDF
Baabtra.com programming at school
PDF
99LMS for Enterprises - LMS that you will love
PPTX
Chapter 6 database normalisation
PPTX
Chapter 5 transactions and dcl statements
PPTX
Chapter 4 functions, views, indexing
PPTX
PPTX
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
PPTX
Chapter 1 introduction to sql server
PPTX
Chapter 1 introduction to sql server
Agile methodology and scrum development
Acquiring new skills what you should know
Baabtra.com programming at school
99LMS for Enterprises - LMS that you will love
Chapter 6 database normalisation
Chapter 5 transactions and dcl statements
Chapter 4 functions, views, indexing
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server
Ad

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Approach and Philosophy of On baking technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Electronic commerce courselecture one. Pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
cuic standard and advanced reporting.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Network Security Unit 5.pdf for BCA BBA.
Spectral efficient network and resource selection model in 5G networks
MYSQL Presentation for SQL database connectivity
Building Integrated photovoltaic BIPV_UPV.pdf
Big Data Technologies - Introduction.pptx
Approach and Philosophy of On baking technology
MIND Revenue Release Quarter 2 2025 Press Release
The AUB Centre for AI in Media Proposal.docx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Per capita expenditure prediction using model stacking based on satellite ima...
Advanced methodologies resolving dimensionality complications for autism neur...
Electronic commerce courselecture one. Pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
NewMind AI Weekly Chronicles - August'25-Week II
“AI and Expert System Decision Support & Business Intelligence Systems”
Diabetes mellitus diagnosis method based random forest with bat algorithm
cuic standard and advanced reporting.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

what is method overloading?

  • 2. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 3. Method Overloading SWALIH T swalihk321@gmail.com www.facebook/ swalih321 twitter.com/swalih321 in.linkedin.com/in/swalih321 9539353663
  • 4. POLYMORPHISM • Polymorphism means more than one form, same object performing different operations according to the requirement. Types • Compile time: Overloading. • Run time: Overriding.
  • 5. Method Overloading • Method overloading means writing two are or more methods in the same class by using same method name, but passing the parameters is different. • Overloading is the practice of supplying more than one definition for a given method name in the same class. The compiler will automatically select the most appropriate one based on the arguments with which it is called.
  • 6. Method Overloading • Overloading is useful to add flexibility to a method. In general, if you want to create a method that adds two numbers then it only take either integer, double, or float but by overloading, you can add values of all data types.
  • 7. Method Overloading There are two ways to overload the method in java o By changing number of arguments o By changing the data type
  • 8. o By changing number of arguments
  • 9. o By changing the data type
  • 10. Advantages of method overloading • It allows you to use the same name for a group of methods that basically have the same purpose. • It provides an easy way to handle default parameter value. • Assume that a method has one required parameter and two optional parameters. Three overloaded forms of this method can be defined. It can accept one, two or three parameters.
  • 11. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  • 12. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com