Static polymorphism in Java with example || Compile time polymorphism in Java [MOST IMP CONCEPT]

preview_player
Показать описание
In this video we have discussed about Static polymorphism in Java in detail

Udemy Course of Code Decode on Microservice k8s AWS CICD link:

Course Description Video :

Ability of an object to take
Many forms. Any object in java that passes IS-A test is polymorphic and since all objects extends Object class hence all object are polymorphic.
E.G.
Frog
Since a frog can behave as
An animal too,
As Terrestrial animal too
And as an aquatic animal too, Hence Frog is Polymorphic object.

Methods having same names but different Parameters is method overloading or static polymorphism. Eg
Add(a,b) and Add(a,b,c)
Both methods add all arguments

Imp**
Overloading / static polymorphism is not possible by changing the return type only. It gives compile time error due to ambiguity.
This video contains static polymorphism example with live demo

The word ‘polymorphism’ literally means ‘a state of having many shapes’ or ‘the capacity to take on different forms’. When applied to object-oriented programming languages like Java, it describes a language’s ability to process objects of various types and classes through a single, uniform interface.

Polymorphism in Java has two types: Compile time polymorphism (static binding) and Runtime polymorphism (dynamic binding). Method overloading is an example of static polymorphism, while method overriding is an example of dynamic polymorphism.

Static Polymorphism in Java,
Static polymorphism,
Java Static polymorphism,
compile time polymorphism in java,
compile time polymorphism,
compile time polymorphism and runtime polymorphism,
difference between compile time polymorphism and runtime polymorphism,
Polymorphism in Java,static and dynamic polymorphism in java

#staticpolymorphism #polymorphism #compiletimepolymorphism
Рекомендации по теме
Комментарии
Автор

Thanks for the explanation. By the way please take into account when the video has the title polymorphism doesn't distract the listener on another thing, like explaining how java braces scope works.

giorgi
Автор

Thanks so much...I have been watching for my interview...great job mam...

jyotikumari-rusp
Автор

u r explaination is great but one mistake we can do overload method by 3 ways: order of arguments, type of arguments and number of arguments

AlokMishra-gh
Автор

Hi your videos are very helpful. You didnt explain the type promotion example.like what if we have 2 methods m1(int a, long b); and m1(long a, int b); and when we call m1(4, 5); which method will be called? and how ambiguity can be resolved.

sukunkusum
Автор

Your explanations are great, can you please share the PPT which you're showing in video

puneetachauhan
Автор

I like you videos.. just try to take pause when you explain. Sometimes runs. Good luck👍🏻

meghatrivedi
Автор

Why overloading also called as static polymorphism??

hamidish