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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access