Skip to content

Polymorphism

Context: Polymorphism allows objects of different types to be treated as objects of a common base type. It enables writing flexible and extensible code.

  • Compile‑time polymorphism (method overloading)
  • Runtime polymorphism (virtual/override)
  • 4.4.1 Compile time overloading
  • 4.4.2 Runtime virtual override
  • 4.4.3 is and as operators