Java API Tutorial - 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;
// w  w w  . ja  v a2s  .c  om
public class Main {
  public static void main(String[] argv) throws Exception {
    AtomicBoolean atomicBoolean = new AtomicBoolean();
    
    atomicBoolean.lazySet(true);
    
  }
}