Polymorphism in java

Polymorphism is a special feature Object Oriented Programming System.The process of representing one form in multiple forms is known as Polymorphism. Different things refered by single name but performing the different task is called Polymorphism .

  Polymorphism is derived from 2 greek words: poly and morphs. The word "poly" means many and "morphs" means forms. So polymorphism means many forms.


Real life example of polymorphism

Suppose if you are in class room that time you behave like a student, when you are in market at that time you behave like a customer, when you are at your home at that time you behave like a son or daughter, when you are at office you behave as boss.Here one person behave differently at different places.

This is a called polymorphic behavior of a person.

Type of Polymorphism in java

In Java there are two type of polymorphism .

1) CompileTime polymorphism

1) RunTime polymorphism

These two polymorphism can be achieved in java with the help concept method overloading and method overriding .