An interface is a collection of constant values and method definitions. An interface is a special kind of abstract class. Java classes are single-inheritance. ClassB Extends Classajava interface can inherit more. Interface3 Extends Interface0, Interface1, interface ... The main reason for not allowing class multiple inheritance is if a inherits both B and C, and B and C have a D method at the same time, how does a determine the inheritance? But the interface does not exist such a problem, the interface is all abstract method inheritance who does not matter, so the interface can inherit multiple interfaces. Note: 1) If a class implements an excuse, it implements all the methods of the interface. 2) The name, return type, and parameters of the method must be exactly the same as the interface. If the return type of the method is not void, the method body must have at least one return statement. 3) Because the method of the interface is the public type by default, the implementation must be decorated with public (otherwise the default is the protected type, narrowing the use of the method).
Java interfaces can inherit multiple interfaces