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;
/*  w w  w. jav  a 2  s.  c  o m*/
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.





















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




AtomicBoolean
AtomicInteger
AtomicIntegerArray
AtomicLong
AtomicLongArray