Basic learning of Java -- Design principles of Java (OOP) programs
Avoid code duplication. Solution: function, parent class;
encapsulation. Try to keep the member variables of each class private, encapsulate data with operations, and reduce direct calls to member variables between classes. Instead, call methods to reduce coupling;
Maximize scalability. Try to use the framework + data model. You can use containers to avoid hard coding. Avoid large-scale code modifications when functionality is expanded in the future.