A class may implement an interface, in which case it provides the body for the methods specified in the interface.
-
public class Picture implements Storable {
-
public void store(Stream s) {
-
// JPEG compress image before storing
-
}
-
public void retrieve(Stream s) {
-
// JPEG decompress image before retrieving
-
}
-
}
-
public class StudentRecord implements Storable {
-
}
|