Polymorphism
Different objects responding to the same method call in their own way.
What is Polymorphism?
Polymorphism ("many shapes") means different objects can respond to the same method call in their own way. Tell every shape to Draw() and circles draw circles while squares draw squares. The calling code doesn't need to know which is which.
List<Shape> shapes = [new Circle(), new Square()];
foreach (var shape in shapes)
{
shape.Draw(); // each shape draws itself
}
Level: Apprentice · More OOP terms at this level
Updated