Summary
Polymorphism means different forms. In object-oriented programming, you have the same face (the common interface in the base class) and different forms using that face: the different versions of the dynamically bound methods.
Youve seen in this chapter that its impossible to understand, or even create, an example of polymorphism without using data abstraction and inheritance. Polymorphism is a feature that cannot be viewed in isolation (like a switch statement can, for example), but instead works only in concert, as part of a big picture of class relationships. People are often confused by other, non-object-oriented features of Java, like method overloading, which are sometimes presented as object-oriented. Dont be fooled: If it isnt late binding, it isnt polymorphism.
To use polymorphismand thus object-oriented techniqueseffectively in your programs, you must expand your view of programming to include not just members and messages of an individual class, but also the commonality among classes and their relationships with each other. Although this requires significant effort, its a worthy struggle, because the results are faster program development, better code organization, extensible programs, and easier code maintenance.