Inheritance The following pages have the complete source code and examples from Chapter 7, Polymorphism and Inheritance, from the Java Developer's Resource. The last chapter concentrated on abstract data typing through classes, objects and methods. Abstract data typing produces code that is much easier to read, understand and maintain. In this chapter you re going to continue our exploration of OOP by investigating its other two primary features, polymorphism and inheritance. Polymorphism allows the programmer to choose an operation without worrying excessively about the data types involved.
Inheritance promotes code reuse and increases programmer productivity.