Java AtomicIntegerArray(int[] array) Constructor

Syntax

AtomicIntegerArray(int[] array) constructor from AtomicIntegerArray has the following syntax.

public AtomicIntegerArray(int[] array)

Example

In the following code shows how to use AtomicIntegerArray.AtomicIntegerArray(int[] array) constructor.


/*from  w  w  w.  j av  a  2s.  c o m*/
import java.util.concurrent.atomic.AtomicIntegerArray;

public class Main {
  public static void main(String[] argv) throws Exception {
    AtomicIntegerArray atomicIntegerArray = new AtomicIntegerArray(new int[]{0,1,2,3});
    
    System.out.println(atomicIntegerArray.length());
  }
}

The code above generates the following result.





















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




AtomicBoolean
AtomicInteger
AtomicIntegerArray
AtomicLong
AtomicLongArray