Home Java Javatutorial What is Polymorphism in Java?
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

What is Polymorphism in Java?

Advertisement
Polymorphism in Java is part of OOPs concept that helps an object to decide which method implementation to be executed after receiving a method call.

Polymorphism in Java means a subclass, though having its own unique behavior, can also share some functionality of its parent class. It is a part of (Object Oriented Programing) OOPs concept that allows object of various types to define a common interface of operations.

Any object that satisfies more than one IS-A relationship is polymorphic. In Polymorphism, common interface is used while writing code. Single polymorphism is achieved by method overriding while multiple polymorphism is when an abstract class uses another abstract class.

In simple words Polymorphism in Java helps an object to decide which method implementation to be executed after receiving a method call.

If we use a common interface it becomes easy to change code to support new implementation.

Polymorphism in Java can be seen through Inheritance, method overloading and method overriding.

In Compile-Time polymorphism uses method signatures to determine which among various methods to be executed after compilation to the byte code.

In Run-Time polymorphism, achieved through overridden methods, a computer does not know which methods to execute till the run time.

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: September 3, 2013

Related Tutorials

Ask Questions?    Discuss: What is Polymorphism in Java?  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com