In Java, single inheritance means that a subclass can have at most one parent class. JAVA does not support multiple inheritance. Single inheritance makes the inheritance relationship of JAVA very simple. A class can only have one parent class, which is easy to manage the program. At the same time, a class can implement multiple interfaces, thereby overcoming the shortcomings of single inheritance.
Java is a simple, object-oriented, distributed, interpreted, robust, secure, architecture-neutral, and portable , high-performance, multi-threaded, dynamic language.
Inheritance
Inheritance is divided into single inheritance and multiple inheritance.
Single inheritance means that a subclass can have at most one parent class.
Multiple inheritance means that a subclass can have more than two parent classes.
Because multiple inheritance brings ambiguity, classes in the Java language only support single inheritance, while interfaces support multiple inheritance.
The function of multiple inheritance in Java is implemented indirectly through interfaces
JAVA does not support multiple inheritance. Single inheritance makes the inheritance relationship of JAVA very simple. A class only Having one parent class makes it easy to manage the program, and one class can implement multiple interfaces at the same time, thereby overcoming the shortcomings of single inheritance.
The above is the detailed content of What is single inheritance in java?. For more information, please follow other related articles on the PHP Chinese website!