O'Reilly logo

The Java™ Tutorial Fourth Edition: A Short Course on the Basics by Mark Hoeber, Tom Risser, Isaac Rabinovitch, Jacob Royal, Scott Hommel, Sharon Zakhour

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required