static int ABSTRACT 
          The int value representing the abstract modifier. 
static int FINAL 
          The int value representing the final modifier. 
static int INTERFACE 
          The int value representing the interface modifier. 
static int NATIVE 
          The int value representing the native modifier. 
static int PRIVATE 
          The int value representing the private modifier. 
static int PROTECTED 
          The int value representing the protected modifier. 
static int PUBLIC 
          The int value representing the public modifier. 
static int STATIC 
          The int value representing the static modifier. 
static int STRICT 
          The int value representing the strictfp modifier. 
static int SYNCHRONIZED 
          The int value representing the synchronized modifier. 
static int TRANSIENT 
          The int value representing the transient modifier. 
static int VOLATILE 
          The int value representing the volatile modifier 

解决方案 »

  1.   

    The volatile keyword is used as a modifier on member variables to force individual threads to reread the variable’s value from shared memory every time the variable is accessed. In addition, individual threads are forced to write changes back to shared memory as soon as they occur. This way, two different threads always see the same value for a member variable at any particular time. Chances are that most of you expected this behavior from the Java VM already. In fact, many experienced Java developers don’t understand when the use of volatile is necessary.
    The volatile keyword is used to tell the VM that it should not keep a private copy of a variable and should instead interact directly with the shared copy.