Cover Page by Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Chapter 17

Polymorphism

Polymorphism is the hardest concept to explain to those new to object-oriented programming (OOP). In fact, most of the time its definition would not make sense without an example or two. Well, try this. Here is the 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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required