= Solution
<Programming language polymorphism> permits \b[one interface or piece of code to work with values of several types], while providing the behavior appropriate to those values. For example a routine that calls `play` through a `Player` reference can use a `Regular`, `Optimistic`, or `House` object without knowing its concrete <software class>.
Use <programming language polymorphism> when clients should depend on a common contract while concrete behavior varies, or when an <algorithm> is independent of the element type. It avoids duplicating client logic or repeatedly inspecting concrete <runtime types>, and supports extensions behind the same interface. A shared interface must still have meaningful behavioral guarantees: merely giving unrelated operations the same name does not establish that implementations can safely replace one another.
Back to article page