Start here · Essential guide
Polymorphism in C++
Learn polymorphism in C++ with clear code examples: virtual functions, override, abstract classes, templates, and the mistakes beginners make most often.
Classes and Design
What polymorphism means, its main types and how it differs from inheritance.
Start here · Essential guide
Learn polymorphism in C++ with clear code examples: virtual functions, override, abstract classes, templates, and the mistakes beginners make most often.
Inheritance reuses code through a base class. Polymorphism lets one interface behave differently for each object. Compare the two with C++ examples.
The four types of polymorphism are overloading, coercion, parametric and inclusion, grouped as ad hoc and universal. Examples in C++ for each one.
In computer science, polymorphism means one name or operation can work with many types or behave in different ways. C++ uses the word in a specific sense too.
Polymorphism in C++ means one call can do different things depending on the object. This simple explanation uses an everyday example and a short code sample.
Related topics