Polymorphism

Polymorphism is the ability to use an object through its parent type or its interface, with the method that runs depending on the object's actual type at runtime (dynamic binding). It lets you write generic code that handles different variants uniformly.

Example

Animal a = new Chien();
a.crier(); // Chien's version

Related concepts

The whole glossary