Polymorphism

The meaning of polymorphism word is MANY forms.

In real-world, water has 3 forms solid(ice), liquid (simple water),  gas(water vapors)

Polymorphism has many forms

Same case in java  we create the method  with different form in java this know as polymorphism

Type of polymorphism

Type of polymorphism

Compile-time polymorphism:

Compile-time polymorphism is handle by the compiler

And compile-time polymorphism is achieved by method overloading

Run-time polymorphism:

Run-time polymorphism is handle by the JVM (Java virtual machine)

And Run-time polymorphism is achieved by method overriding

We will learn about the method  overloading and method overriding  in detail in the next article

Now, we understand different between method  overloading and method overriding 

difference between method overloading and method overridng



SHARE THIS PAGE





Important Link