1 |
Interfaces are either public or have the default friendly access (public for the package and private elsewhere)
|
2 |
Methods in an interface are always abstract and have the same access as the interface. No other modifiers may be applied
|
3 |
Variables in an interface are public, static, and final. They must be initialized.
|
4 |
Interfaces can incorporate one or more other interfaces, using the extends keyword:
-
public interface DoesItAll extends Storable, Paintable {
-
public abstract void doesSomethingElse();
-
}
|
5 |
A class can implement more than one interface:
-
public class Picture implements Storable, Paintable {
-
public void store(Stream s) {...}
-
public void retrieve(Stream s) {...}
-
public void refresh() {...}
-
}
|