Interface:
Interface is the realization of the same function in many parent classes, can be implemented more;
The public modifier in the interface is necessary, in the subclass that is, the implements interface can not be less than the decoration of the interface is the need to use public, the default is no, because its permissions are default;
An abstract method in an interface is not a principal, and it is implemented by a subclass by overriding it.
The format of the interface:
public static final Capital English name ();
public abstract void Method name ();
When to use the interface:
In addition to the common functions of the parent class, other specific functions of friends, and subclasses are not indispensable, you can define the interface and then to implement it.
Benefits of the interface:
Greatly improve the extensibility of the Code;
So that the class and class are not so coupled;
A class can implement multiple interfaces, and functions can be extended.
216.7.14 interface