Java API Tutorial - Java AtomicBoolean() Constructor








Syntax

AtomicBoolean() constructor from AtomicBoolean has the following syntax.

public AtomicBoolean()

Example

In the following code shows how to use AtomicBoolean.AtomicBoolean() constructor.

import java.util.concurrent.atomic.AtomicBoolean;

public class Main {
  public static void main(String[] argv) throws Exception {
    AtomicBoolean atomicBoolean = new AtomicBoolean();
    
    System.out.println(atomicBoolean);
  }
}

The code above generates the following result.