Three Java features

1. Encapsulate the properties and functions of hidden classes, enhance the security of classes and simplify programming, and use class members with specific access rights by providing common interfaces. 2. Inheritance Extracts common features and behaviors to form a parent class. Inheritance means that a subclass inherits the features and behaviors of the parent class, so that the subclass has the functions and features of the parent class and can extend but not modify the functions of the parent class. The ability to have many different manifestations or forms of the same behavior. Means that the same method of a class instance can be represented differently in different situations.

The five principles of

1. Richter’s substitution Principle A subclass can replace the parent class and extend the function of the parent class, but cannot change the function of the parent class; Subclasses can implement abstract methods of the parent class, but cannot override non-abstract methods of the parent class. The principle of single responsibility a class is responsible for a single responsibility 3. Interface isolation The principle of multiple specialized interfaces is better than a single interface, and a class should not be forced to implement an interface that it does not need 4. The principle of dependency inversion reduces the decoupling between code and implementation module by relying on abstract interface rather than concrete implementation. 5. The open and closed principle is open to class code modification and extension, but closed to modification;