I. Using the static modifier variable: When shared data is present in an object, the data is statically decorated, and the unique data in the object is defined as non-static in heap memory.
Two. Use static to modify static functions: When there is no access to non-static data (object-specific data) inside the function, it can be defined as static.
Three. Tool classes are designed to encapsulate functionality (in order to encapsulate data), there are no attribute data in the tool class, and only methods that implement various functions are static. To prevent objects in other classes from creating tool classes (tool class objects are meaningless), you can privatize the constructor method of the tool class. Methods that do not need to be opened to the outside of the tool class (the other method calls in these methods feature tool classes) are also privatized.
About when to use static and tool class knowledge in Java