23static and final keyword

This modifier is equivalent to two Keywords

static modification variables, methods, code blocks, inner class

1. Variable ---- static variables

 

With static variables modified to become a class variable, with the class loading (static constant pool area method) and loaded into the method area static area, static variables and class at the same level he was before the existence of the object, so the point is made by the class name to call a static variable, of course, you can also point out the object.

Static variables are stored in the method area static area, it will provide an address outside, all subsequently created objects that share an address, static variables are unique. When this property or want all variable objects can be shared, is set to static

 

The method can be defined in static variables? Static variables and class at the same level, because the contents of the method is invoked not only perform ----

Constructed a block of code you can define static variables do? Static class variables may not at the same level, with the object code blocks constructed in the same level.

 

2. static method 08pm164 min

Guess you like

Origin www.cnblogs.com/xuwangqi/p/11093697.html