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
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
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