SlideShare a Scribd company logo
1 of 12
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?

Method Overloading In Java
Method Overloading In JavaMethod Overloading In Java
Method Overloading In JavaCharthaGaglani
Ā 
Unit 2 Part 1 POLYMORPHISM.pdf
Unit 2 Part 1 POLYMORPHISM.pdfUnit 2 Part 1 POLYMORPHISM.pdf
Unit 2 Part 1 POLYMORPHISM.pdfArpana Awasthi
Ā 
overloading
overloadingoverloading
overloadingcpsivaku
Ā 
Episode 3 ā€“ Classes, Inheritance, Abstract Class, and Interfaces
Episode 3 ā€“ Classes, Inheritance, Abstract Class, and InterfacesEpisode 3 ā€“ Classes, Inheritance, Abstract Class, and Interfaces
Episode 3 ā€“ Classes, Inheritance, Abstract Class, and InterfacesJitendra Zaa
Ā 
2CPP11 - Method Overloading
2CPP11 - Method Overloading2CPP11 - Method Overloading
2CPP11 - Method OverloadingMichael Heron
Ā 
Refactoring: Improve the design of existing code
Refactoring: Improve the design of existing codeRefactoring: Improve the design of existing code
Refactoring: Improve the design of existing codeValerio Maggio
Ā 
Unit 7 inheritance
Unit 7 inheritanceUnit 7 inheritance
Unit 7 inheritanceatcnerd
Ā 
CIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in JavaCIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in JavaHamad Odhabi
Ā 
Understanding Mahout classification documentation
Understanding Mahout  classification documentationUnderstanding Mahout  classification documentation
Understanding Mahout classification documentationNaveen Kumar
Ā 
Object Oriented Programming C#
Object Oriented Programming C#Object Oriented Programming C#
Object Oriented Programming C#Muhammad Younis
Ā 
BCA Oveloading and Overriding (2).pptx
BCA Oveloading and Overriding (2).pptxBCA Oveloading and Overriding (2).pptx
BCA Oveloading and Overriding (2).pptxSarthakSrivastava70
Ā 
Transfer learning-presentation
Transfer learning-presentationTransfer learning-presentation
Transfer learning-presentationBushra Jbawi
Ā 
04_-_Inheritance_Polymorphism_and_Interfaces.pdf
04_-_Inheritance_Polymorphism_and_Interfaces.pdf04_-_Inheritance_Polymorphism_and_Interfaces.pdf
04_-_Inheritance_Polymorphism_and_Interfaces.pdfmarkbrianBautista
Ā 
cyberbullyingdetectionusingmachinelearning-11-220913143556-fec10e26.pptx
cyberbullyingdetectionusingmachinelearning-11-220913143556-fec10e26.pptxcyberbullyingdetectionusingmachinelearning-11-220913143556-fec10e26.pptx
cyberbullyingdetectionusingmachinelearning-11-220913143556-fec10e26.pptxSaiKiran101146
Ā 

Similar to what is method overloading? (20)

Method Overloading In Java
Method Overloading In JavaMethod Overloading In Java
Method Overloading In Java
Ā 
Unit 2 Part 1 POLYMORPHISM.pdf
Unit 2 Part 1 POLYMORPHISM.pdfUnit 2 Part 1 POLYMORPHISM.pdf
Unit 2 Part 1 POLYMORPHISM.pdf
Ā 
overloading
overloadingoverloading
overloading
Ā 
Episode 3 ā€“ Classes, Inheritance, Abstract Class, and Interfaces
Episode 3 ā€“ Classes, Inheritance, Abstract Class, and InterfacesEpisode 3 ā€“ Classes, Inheritance, Abstract Class, and Interfaces
Episode 3 ā€“ Classes, Inheritance, Abstract Class, and Interfaces
Ā 
OOPSCA1.pptx
OOPSCA1.pptxOOPSCA1.pptx
OOPSCA1.pptx
Ā 
2CPP11 - Method Overloading
2CPP11 - Method Overloading2CPP11 - Method Overloading
2CPP11 - Method Overloading
Ā 
OOPS Characteristics
OOPS CharacteristicsOOPS Characteristics
OOPS Characteristics
Ā 
Refactoring: Improve the design of existing code
Refactoring: Improve the design of existing codeRefactoring: Improve the design of existing code
Refactoring: Improve the design of existing code
Ā 
Unit 7 inheritance
Unit 7 inheritanceUnit 7 inheritance
Unit 7 inheritance
Ā 
Method overloading
Method overloadingMethod overloading
Method overloading
Ā 
CIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in JavaCIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in Java
Ā 
Understanding Mahout classification documentation
Understanding Mahout  classification documentationUnderstanding Mahout  classification documentation
Understanding Mahout classification documentation
Ā 
4.1.pptx
4.1.pptx4.1.pptx
4.1.pptx
Ā 
Object Oriented Programming C#
Object Oriented Programming C#Object Oriented Programming C#
Object Oriented Programming C#
Ā 
BCA Oveloading and Overriding (2).pptx
BCA Oveloading and Overriding (2).pptxBCA Oveloading and Overriding (2).pptx
BCA Oveloading and Overriding (2).pptx
Ā 
Transfer learning-presentation
Transfer learning-presentationTransfer learning-presentation
Transfer learning-presentation
Ā 
Method overloding
Method overlodingMethod overloding
Method overloding
Ā 
Lec 1.9 oop
Lec 1.9 oopLec 1.9 oop
Lec 1.9 oop
Ā 
04_-_Inheritance_Polymorphism_and_Interfaces.pdf
04_-_Inheritance_Polymorphism_and_Interfaces.pdf04_-_Inheritance_Polymorphism_and_Interfaces.pdf
04_-_Inheritance_Polymorphism_and_Interfaces.pdf
Ā 
cyberbullyingdetectionusingmachinelearning-11-220913143556-fec10e26.pptx
cyberbullyingdetectionusingmachinelearning-11-220913143556-fec10e26.pptxcyberbullyingdetectionusingmachinelearning-11-220913143556-fec10e26.pptx
cyberbullyingdetectionusingmachinelearning-11-220913143556-fec10e26.pptx
Ā 

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

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

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
Ā 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
Ā 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
Ā 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
Ā 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
Ā 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
Ā 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
Ā 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
Ā 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
Ā 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
Ā 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
Ā 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
Ā 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Ā 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
Ā 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
Ā 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
Ā 
Blue brain
Blue brainBlue brain
Blue brain
Ā 
5g
5g5g
5g
Ā 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
Ā 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
Ā 

Recently uploaded

šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜RTylerCroy
Ā 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
Ā 
Scaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationScaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationRadu Cotescu
Ā 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĆŗjo
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
Ā 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
Ā 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
Ā 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
Ā 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
Ā 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Ā 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
Ā 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Ā 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024The Digital Insurer
Ā 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
Ā 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
Ā 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
Ā 

Recently uploaded (20)

šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜
Ā 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
Ā 
Scaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationScaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organization
Ā 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Ā 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
Ā 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Ā 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Ā 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
Ā 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Ā 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Ā 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Ā 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024
Ā 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Ā 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Ā 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
Ā 

what is method overloading?

  • 1.
  • 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