Static can modify properties and methods. All static modification methods and properties are related to the class, and are loaded with special processing (including attributes and class priority loading). The difference between the static modifier property and the method is compared below:
First, modify the properties of the time.
1, the use of static modified properties, can be accessed with the object, or can be directly accessed with the class name;
2, when using the static modifier property, the data is the static area of the data segment, and the whole class share a value;
3, in semantics, the attribute is related to the class, not to the object;
4, in the use, is generally constant or the whole class of shared data only with static modification;
Second, the time to modify the method.
1, the use of static modification method, you can use the object to access, you can also use the class name directly access;
2, using the static modification method, can only manipulate the property, call other static methods of the same, and can not use this and super;
3, when used, if a method is only related to the class, and the object is independent of the use of static decoration (most of the tool nature uses static decoration);
4, in the loading time is the priority load;
A little knowledge of static in Java