Interfaces Versus Abstract Classes
Granting Permission Through an Interface—Cloneable
What Protected Really Means
Using Interface Callbacks for GUI Event Handlers
The Class Double
Some Light Relief—The Java-Powered Toaster
Interfaces are an important concept in Java. In this chapter, we'll explain what interfaces do, and how you use them. Here's a summary of what interfaces do, so you can see where we're headed.
In a few words, an interface is similar to a class that only abstract methods. You can't instantiate an abstract class; its purpose is to force any subclasses to implement its methods. That allows other classes to rely ...