ProgrammingModerateWipro · Capgemini pattern

Which pairing is correct?

  1. A. Both are resolved at run time
  2. B. Both are resolved at compile time
  3. C. Overloading is resolved at compile time; overriding is resolved at run time
  4. D. Overloading is resolved at run time; overriding is resolved at compile time

Correct answer: C. Overloading is resolved at compile time; overriding is resolved at run time

The compiler picks an overload from the argument types it can see (static polymorphism). Which override runs depends on the actual object at run time (dynamic dispatch).

More OOP with C++ and Java questions

Exams that ask this topic