What is Method Overloading in Java || Understand Polymorphism with example

Selenium Express
Selenium Express
9.9 هزار بار بازدید - 7 سال پیش - This tutorial covers the first
This tutorial covers the first type of polymorphism in java which is called method overloading(Static polymorphism). Throughout this entire tutorial, we will learn the meaning of polymorphism and how can we achieve that by using method overloading by a working example.

If we talk about oops concepts in java there are 4 major things :

1.Encapsulation
2.Polymorphism
3.Abstraction
4Inheritance

Polymorphism
===========

The concept of defining multiple functionalities with the same name with respect to a single object is known as polymorphism.
There are two types of polymorphism in java and they are

1.Static polymorphism 2. Dynamic polymorphism

We can achieve static polymorphism in java by using method overloading and we can achieve dynamic polymorphism by using method overriding.

method overloading in java
=======================
The concept of defining multiple methods with the same name,same number of parameters or different number of parameters is called method overloading.

If the no of parameters is same, the datatype of the parameters must be different with respect to a single object.

Among multiple methods based on the no of parameters and type of the parameters, the corresponding method will be executed.

So let's understand what is method overloading in java with a full working example.

=============
Please subscribe to my channel by clicking on the link below.

@seleniumexpress

Stay tuned and like my Facebook page for more.

Facebook: seleniumexpress


Music :
-----------
credits : -

Adventures by A Himitsu SoundCloud: a-himitsu
Creative Commons — Attribution 3.0 Unported— CC BY 3.0
http://creativecommons.org/licenses/b...
Music released by Argofox A Himitsu - Adventures [Royalty Free ...
Music provided by Audio Library Adventures – A Himitsu (No Copyright ...


-----

intro template :
wwww.youtube.com/Alexbau01
7 سال پیش در تاریخ 1396/09/19 منتشر شده است.
9,984 بـار بازدید شده
... بیشتر