Implementing an interface
As for an abstract class, one cannot directly create an instance of an interface.
Unlike an abstract class, one cannot even extend an interface to create a class. An interface is not a class, and it cannot have subclasses.
Instead, a class must implement an interface:
public class Picture implements Storable {
public void store(Stream s) {
// JPEG compress image before storing
. . .
}
public void retrieve(Stream s) {
// JPEG decompress image after retrieving
. . .
}
}