VISIT GITHUB TO SEE MY PROJECTS GO

What is Polymorphism ? | Static or Compile-time, Dynamic Polymorphism | survnor.blogspot.com

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated

What is Polymorphism?

Polymorphism as the ability of a message to be displayed in more than one form.


Polymorphism is one of the core concepts in OOP languages and describes the concept wherein you can use different classes with the same interface.

Each of these classes can provide its own implementation of the interface.



Static Polymorphism

You can overload method with a different sets of parameters. This is called static polymorphism because the compiler statically binds the method call to a specific method.



Java supports 2 types of polymorphism:

● Static or Compile-time

● Dynamic



Dynamic Polymorphism

Within inheritance hierarchy, an a subclass can override a method of its superclass. If you instantiate the subclass, the JVM will always call the overridden method, even if you cast the subclass to its superclass. That is called dynamic polymorphism.

Hope this post helped you, Thankyou for reading
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.