Inheritance, subclasses in Java inherit the method of the parent class and put some own "feature (method)" on this basis. Its benefits are not to rewrite classes because of new needs (more duplicate code in the class), we only need to write a class (subclass) that is newly needed to contain new "features (method)". Inheriting the class (parent class) containing the methods we need. Thereby simplifying our writing process, and in certain ways, the program is more organized. There is also a benefit that inheritance is that it can be traced shape, that is, the process of derivating the type (subtype) as its basic type (parent type) processing. Thinking in Java's example of ShaP has been very clear: We wrote such a function with Java: void dostuff (shape s) {s.rase (); // ... s.draw ();} We are Some programs call this function, circle c = new circle (); triangle t = new triangle (); line l = new line (); dostuff (c); dostuff (t); dostuff (L); a circle The handle is passed to a function that is currently looking forward to the Shape handle. Since the circle is a geometric shape, dostuff () can be processed correctly. That is, any dostuff () can be sent to a shape message, Circle can also receive. So doing this is safe and will not cause errors. It should be noted that there is no other method between the subclass and the parent class, that is, the method in the subclass must not cover the method in the parent class, how to avoid this problem? We can use Final to limit.