10.13 Program to an Interface, Not an Implementation3

Implementation inheritance via extends has been explained in detail in Chapters 9 and 10. Recall that Java does not allow a class to inherit from more than one superclass.

With interface inheritance, a class implements an interface describing various abstract methods that the new class must provide. The new class also may inherit some method implementations (allowed in interfaces as of Java SE 8), but no instance variables. Recall that ...

Get Java How to Program, Early Objects, 11th 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.