Design patterns·Objects, messages and the principles
the same call site does three different things depending on what was passed in, and there is no branch anywhere.
Polymorphism
Also calledsubtype polymorphism, polymorphic
One name standing for behaviour that varies by the runtime type of the thing it is called on. It is the mechanism underneath most of the behavioural patterns — strategy, state, visitor and template method are all polymorphism with a particular story attached. The reason interviewers keep asking about it is that the alternative, a conditional over a type tag, is what most real code does instead, and the difference shows up on the day a fourth case is added.