ProgrammingEasyTCS NQT · Infosys interview pattern

A method call such as shape.area() runs different code depending on whether shape refers to a Circle or a Square object at run time. Which OOP feature is this?

  1. A. Encapsulation
  2. B. Compile-time polymorphism (method overloading)
  3. C. Runtime polymorphism (dynamic dispatch through overriding)
  4. D. Data abstraction through access specifiers

Correct answer: C. Runtime polymorphism (dynamic dispatch through overriding)

Choosing the overridden method from the object’s actual class at run time is runtime polymorphism. Overloading is resolved at compile time from the argument types, and encapsulation is about bundling and hiding data.

More OOP with C++ and Java questions

Exams that ask this topic