Polymorphism is an object’s capacity to change shape. It’s mostly used to refer to a child/derived class reference from a base/parent class. In Java, there are two forms of polymorphism:
Compile-time polymorphism: Compile-time polymorphism is method overloading in which two or more methods with the same name, arguments/parameters, and return type have the same name.
Polymorphism at runtime: The Dynamic Method’s polymorphism at runtime. The user can utilize Dispatch to resolve the override method during runtime rather than at build time. The object of a superclass is the overridden method.