Chapter 8. Interfaces
Interfaces are an important concept in Java. In this chapter we’ll explain how you use interfaces and how they work. We’ll start by describing the problem that they solve.
What Problem Does an Interface Solve?
We’ve seen in previous chapters how classes can be related in a hierarchy, with the common behavior higher up the tree. An example is given in Figure 8-1.
Figure 8-1. Where should the refuel() ...