【Static】

Static features:
A: With the loading of the class loading. Recall that the main method
B: static member variables and member methods can be modified.
C: precedence over object exists.
D: All classes of objects are shared. (Nationality), in fact, this feature tells us when to use static. That is, if a member variable is all of
Like sharing, then it should be defined as static.
Example: water dispenser (static modification). Cups (not static modification).
E: can be invoked through the class name. In fact, it can call itself by its object name.

Guess you like

Origin www.cnblogs.com/zuixinxian/p/11276381.html