Advanced
Object-Oriented Programming Concepts
Q81 / 100
What is "double dispatch" and why is it relevant to polymorphism?
Correct! Well done.
Incorrect.
The correct answer is A) A mechanism where the method executed depends on the runtime types of two objects involved (e.g. the receiver and an argument), beyond simple single dispatch
A
Correct Answer
A mechanism where the method executed depends on the runtime types of two objects involved (e.g. the receiver and an argument), beyond simple single dispatch
Explanation
Most OOP languages support single dispatch (based on the receiver's type only); double dispatch resolves behavior based on two objects' types, often implemented via the Visitor pattern.
Progress
81/100