filmov
tv
What is Method Overloading in Java || Understand Polymorphism with example
Показать описание
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.
Stay tuned and like my Facebook page for more.
Music :
-----------
credits : -
Creative Commons — Attribution 3.0 Unported— CC BY 3.0
-----
intro template :
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.
Stay tuned and like my Facebook page for more.
Music :
-----------
credits : -
Creative Commons — Attribution 3.0 Unported— CC BY 3.0
-----
intro template :
Комментарии