Java AtomicBoolean.lazySet(boolean newValue)

Syntax

AtomicBoolean.lazySet(boolean newValue) has the following syntax.

public final void lazySet(boolean newValue)

Example

In the following code shows how to use AtomicBoolean.lazySet(boolean newValue) method.


import java.util.concurrent.atomic.AtomicBoolean;
/*from   w w w. jav a  2 s  .com*/
public class Main {
  public static void main(String[] argv) throws Exception {
    AtomicBoolean atomicBoolean = new AtomicBoolean();
    
    atomicBoolean.lazySet(true);
    
  }
}




















Home »
  Java Tutorial »
    java.util.concurrent.atomic »




AtomicBoolean
AtomicInteger
AtomicIntegerArray
AtomicLong
AtomicLongArray