Polymorphism in Java is a concept by which we can perform a single action in different ways. ... So polymorphism means many forms. There are two types of polymorphism in Java: compile-time polymorphism and runtime polymorphism. We can perform polymorphism in java by method overloading and method overriding.
Ad-hoc, Inclusion, Parametric & Coercion Polymorphisms
Ad-hoc Polymorphism, also called as Overloading.
Inclusion Polymorphism, also called as Subtyping.
Coersion Polymorphism, also called as Casting.
Parametric Polymorphism, also called as Early Binding.
The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object. Any Java object that can pass more than one IS-A test is considered to be polymorphic.
Java supports two kinds of polymorphism. You can overload a method with different sets of parameters. This is called static polymorphism because the compiler statically binds the method call to a specific method. Within an inheritance hierarchy, a subclass can override a method of its superclass
Polymorphism is considered one of the important features of Object-Oriented Programming. Polymorphism allows us to perform a single action in different ways. In other words, polymorphism allows you to define one interface and have multiple implementations.
Polymorphism means more than one form, same object performing different operations according to the requirement. Method overloading means writing two or more methods in the same class by using same method name, but the passing parameters is different.