Polymorphism
Polymorphism means the same method call can behave differently depending on the object.
Different shapes can each define their own area(), yet you call them the same way.
- Each class defines its own version of a method
- You can treat different objects uniformly
- The correct version runs automatically
Try it yourself
Loading editor…