JAVA inherits extends and java inherits extends
/* Inheritance 1. improves code reusability, simplifies code 2, and creates an inheritance relationship between classes. Note the following polymorphism features: do not create an inheritance relationship to simplify the code in order to obtain the functions of other classes. The inheritance relationship must exist between the class and the class: is) 3. sub-classes have members of the parent class 4. sub-classes cannot have members of the parent class after being Private. 5. JAVA supports multi-layer inheritance. The lowest-level sub-classes in multi-layer inheritance have the entire inheritance system. member, description of the commonalities of all sub-classes defined in the parent class at the top layer JAVA does not support multi-inheritance, but only supports single inheritance, because multi-inheritance has security risks (this multi-inheritance is not multi-layer inheritance, but a class does not support inheriting multiple classes at the same time. When multiple parent Classes define the same members, the subclass object is not sure which one to run. JAVA retains this mechanism and uses another method to demonstrate (multiple implementations) * // parent class, superclass, base class Porson {String name; int age ;} // subclass class Student extends Porson {void stuby () {System. out. println ("Learning") ;}// subclass class Teather extends Porson {void teath () {System. out. println ("") ;}} public class Test {public static void main (String [] args) {}}/* English extension: porson: student teather: instructor */