polymorphism
One call, different behavior depending on the object's real type.
Subtype polymorphism dispatches a virtual member call to the override belonging to the object's run-time type.
Loading interactive…
Examples
Shape s = new Circle(2);thens.Area()runsCircle's version ofArea, even thoughsis typedShape.
See also