Chapter 5. Interfaces and Inheritance
YOU saw an example of implementing an interface in the previous chapter. You can read more about interfaces here—what they are for, why you might want to write one, and how to write one.
This chapter also describes the way in which you can derive one class from another, that is, how a subclass can inherit fields and methods from a superclass. You will learn that all classes are derived from the Object
class, and how to modify the methods that a subclass inherits from superclasses. This chapter also covers interface-like abstract classes.
Interfaces
There are a number of situations in software engineering when it is important for disparate groups of programmers to agree to a “contract” that spells out how their ...
Get The Java™ Tutorial Fourth Edition: A Short Course on the Basics 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.