Java Polymorphism -

It is a process of creating a class with multiple methods with same method name with different implementations is called polymorphism.

Implementation of polymorphism -

We can implement polymorphism by using

Method Overriding
Method Overloading
To develop polymorphism we must define method in all subclass with same name with same prototype as it is declared in superclass.

Java Supports two types of polymorphism -

Compile-time polymorphism
Run-time polymorphism
Compile time polymorphism or Static binding or Early binding

When a method is invoked, if its method definition which is bind at compile time by compiler is only executed by JVM at runtime. Then it is called compile-time polymorpism or static binding or early binding.

Run-time Polymorphism or Dynamic binding or Late binding

When a method is invoked, the method definition which is bind at compile time does not executed at run-time, instead of that is it executed from subclass then it is called runtime polymorphism.

Only non-static overridden method comes under run-time polymorphism. private non-static methods and default non-static mehtod from outside package are not overridden. SO these method call comes under compile time polymorphism.