Java Polymorphism
First, polymorphism means many forms. In Java, the same method can behave differently in different situations. In other words, one method can have multiple forms, and each form can provide different functionality or behavior.
there are two type of Polymorphism and Compile-time Polymorphism, Method overloading and method overriding are the two ways to achieve polymorphism in Java
- Compile-time Polymorphism (Static Polymorphism)
- Runtime Polymorphism (Dynamic Polymorphism)