Chapter 7. Polymorphism
The first OOP principle, encapsulation, was explored in Chapter 5 (by way of classes and objects). Inheritance, the second OOP principle, was the focus of Chapter 6. The current chapter completes an exploration of the OOP principle trilogy, by exploring polymorphism. Chapter 7 explores the four different categories of polymorphism. As you will learn, only two of those categories represent genuine polymorphism. One of the two genuine polymorphism categories is next explored, by way of a discussion on method binding. What are abstract classes and what have they got to do with polymorphism? You will find an answer to those questions in this chapter, and discover (in an unusual way) how abstract classes and interfaces work ...
Get Java™ 2 by Example, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.