juniorOOP

What is polymorphism in OOP?

Updated May 17, 2026

Short answer

Polymorphism allows the same interface to behave differently based on context.

Deep explanation

It enables method overriding and overloading so objects can take many forms at runtime or compile time.

Real-world example

A payment system where different payment methods behave differently.

Common mistakes

  • Confusing polymorphism with inheritance only.

Follow-up questions

  • What is runtime polymorphism?
  • What is compile-time polymorphism?

More OOP interview questions

View all →