Chapter 6. Interfaces

I said previously that everything in a Java program is done by objects interacting with other objects and that those objects must be defined by classes. Well, that's basically true, but there is one important exception. Java has a special entity called an interface. I don't mean the term in the generic sense that interface is often used in software parlance, as a way to access some code. This use of interface essentially refers a list of abstract methods that specifies the names of behaviors that classes can have. An interface, however, has no implementation of the methods in it. Abstract methods have no implementation, but must be implemented by a subclass of the abstract class that declares the abstract method(s). There ...

Get PURE Java™ 2 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.