Section 10.1 Introduction

• Polymorphism (p. 396) enables us to write programs that process objects that share the same superclass as if they were all objects of the superclass; this can simplify programming.

• With polymorphism, we can design and implement systems that are easily extensible. The only parts of a program that must be altered to accommodate new classes are those that require direct knowledge of the new classes that you add to the hierarchy.

Get Java™ How To Program (Early Objects), Tenth 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.