About this document
Understanding Polymorphism in Java by Harisanker Madai is a document available to read on EtoBox.
Polymorphism allows an object to take on multiple forms. It occurs when a parent class reference refers to a child class object. Any object that passes more than one "IS-A" test is considered polymorphic. A reference variable can refer to any object that is its declared type or a subtype. Virtual methods allow polymorphism - an overridden method will be invoked at runtime based on the actual object type, not the reference variable type. In an example, two Salary objects are instantiated - one using a Salary
- Author
- Harisanker Madai
- Language
- EN