Classes in Java do not support multiple inheritance, only single inheritance (that is, a class has only one parent). However, the interface in Java supports multiple inheritance, that is, a sub-interface can have multiple parent interfaces. (The function of the interface is to extend the function of the object, a sub-interface inherits multiple parent interfaces, indicating that the sub-interface extends several functions, when the class implements the interface, the class expands the corresponding function).
Java only supports single inheritance for security reasons, if the subclass inherits more than one parent class that has the same method or attribute, the subclass does not know what to inherit, and the interface can be implemented more, because the interface only defines the method, there is no concrete logical implementation, and many implementations also need to implement the method again.
Does Java support multiple inheritance?