CHAPTER 9
INHERITANCE AND INTERFACES
CHAPTER GOALS
To learn about inheritance
To implement subclasses that inherit and override superclass methods
To understand the concept of polymorphism
To be familiar with the common superclass Object and its methods
To work with interface types
CHAPTER CONTENTS
Syntax 9.1: Subclass Declaration
Common Error 9.1: Replicating Instance Variables from the Superclass
Common Error 9.2: Confusing Super- and Subclasses
Common Error 9.3: Accidental Overloading
Common Error 9.4: Forgetting to Use super When Invoking a Superclass Method
Special Topic 9.1: Calling the Superclass Constructor
Syntax 9.2: Constructor with Superclass Initializer
Special Topic 9.2: dynamic Method Lookup and the Implicit Parameter
Special Topic 9.3: Abstract Classes
Special Topic 9.4: final Methods and Classes
Special Topic 9.5: Protected Access
How To 9.1: developing an Inheritance Hierarchy
Worked Example 9.1: Implementing an Employee Hierarchy for Payroll Processing
Video Example 9.1: Building a discussion Board
Get Java For Everyone: Compatible with Java 5, 6, and 7, 2nd 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.