Interface: Make up a single principle that subclasses inherit from a parent class, allowing classes that have no inheritance relationships to share behavior.
The Java interface itself has no implementation, because the Java interface does not involve appearances, but only describes the public behavior, so the Java interface is more abstract than the Java abstract class. But an interface is not a class, and an interface cannot be instantiated with the new operator
Interface keyword: Used to define an interface.
Interfaces: Defining properties: public static constants;
Definition method: Public, abstract method;
Use interface: 1, let subclass to implement interface, implements keyword, implement. All the abstract methods of an interface must be implemented, unless the implementation class is an abstract class.
2, the interface can inherit the interface. Extends a method that has a parent interface for the child interface.
An interface property can only be a static constant that is exposed. Methods can only be public abstract methods, and cannot have constructors.
Design interface Principle: interface Isolation principle (minimum interface principle), and do not cause the upper interface to pollute the lower interface.
Innate behavior, designed as a class.
The behavior of the attached add, designed as an interface.
interface and dynamic binding, the reference to the interface can point to the object of the real class.
Java from small white to getting started, Day9. Javaoo-interface