Interface:
The field in the interface must be a constant, the method can only be an abstract instance method, the interface cannot have constructors and initialization block definitions
Class A implements interface, in class B you can use to define an interface b= (Interface) Class A, and then call B. The method implemented in class A to implement a call to Class A method in class B
where interface B = (interface) Class A is called upward transformation, the method in Class A corresponding to interface B will overwrite the method of interface B, that is, call the B. Method at this point, and actually call the method implemented in Class A
The upward transformation can be used in inheritance, more flexible, and must be shifted upward before it is transformed in Java, because the subclass reference cannot point to the parent class object, only to the subclass object, so move up and then down.
You can use instance of to prevent possible relationship errors between the parent and child classes
JAVA interface-Oriented programming