8.4 Interfaces and Abstract Classes

Art, it seems to me, should simplify. that, indeed, is very nearly the whole of the higher artistic process; finding what conventions of form and what details one can do without and yet preserve the spirit of the whole . . .

—WILLA CATHER, On The Art of Fiction

Chapter 5 defined a class interface as the portion of a class that tells a programmer how to use it. In particular, a class interface consists of the headings for the public methods and public named constants of the class, along with any explanatory comments. Knowing only a class’s interface—that is, the specifications of its public methods—a programmer can write code that uses the class. The programmer does not need to know anything about the class’s ...

Get Java: An Introduction to Problem Solving and Programming, 8th 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.