volatile Java Keyword

The volatile keyword may be used to indicate a member variable that may be modified asynchronously by more than one thread.

Note: the volatile keyword is not implemented in many Java Virtual Machines.

Examples

  public class MyClass
  {
     volatile int sharedValue;
  }
  

Remarks

Related Topics

None.