Polymorphism is the hardest concept to explain to those new to object-oriented programming (OOP). In fact, most of the time its definition does not make sense without an example or two. Well, try this. Here is a definition in many programming books: Polymorphism is an OOP feature that enables an object to determine which method implementation to invoke upon receiving a method call. If you find this hard to digest, you’re not alone. Polymorphism is hard to explain in simple language, but it does not mean the concept is hard to understand.
This chapter starts with a simple example that should make polymorphism crystal clear. It then proceeds with another example that demonstrates the use of polymorphism with reflection. ...