One, inherit
When some classes have some common content, these common elements can be extracted into the parent class.
1. Analysis of properties and methods common to multiple classes
2. Extract a parent class from the common, create a parent class, and share the same content to the parent class, this class retains only the unique content
3. Subclass inherits parent class using extends
public class subclass name extends parent class name {
}
Super
Call construct: Super (parameter);//put on first line
Call member: Super. Property Super. Method Name ();
In the construction method, super and this cannot be used together
Invocation of a constructor method in an inheritance relationship
The non-parametric construction method of the parent class takes precedence regardless of whether the parent constructor is explicitly called
Properties and methods that do not inherit the private adornment of a parent class
Jen Baby Java basic Note inheritance