java keyword static

 

 

static method is not this way, the internal static methods can not call non-static methods, in turn, is possible. And you can create any objects in the absence of the premise, only to call the static method through the class itself. This actually is the main purpose of static methods. 

                                                                                                                                     - "Java programming ideas"

static, easy to make a call to a method, property, without creating an object;

Modified static member variables

Modified static variable called "static variable", Global on a copy of the non-static variables, global may have N;

 

static modification methods

Modified static method is called "static method", can not use this, super keyword, you can not call non-static properties;

 

modified static block

modified static block of code will only be loaded once, static modification of the code block can only access "static variable"

Guess you like

Origin www.cnblogs.com/devan/p/11536175.html