Polymorphism is the ability of an object to take on many forms.
多态是同一个行为具有多个不同表现形式或形态的能力.
Any Java object that can pass more than one IS-A test is considered to bepolymorphic.
There are two kinds of polymorphism:
- Compile time polymorphism - Ex: Function Overloading, Operator Overloading.
- Run time polymorphism - Ex: Inheritance + virtual functions + base class pointer.