Java AtomicIntegerArray .lazySet (int i, int newValue)

Syntax

AtomicIntegerArray.lazySet(int i, int newValue) has the following syntax.

public final void lazySet(int i,  int newValue)

Example

In the following code shows how to use AtomicIntegerArray.lazySet(int i, int newValue) method.


//w w w. ja  v a2s  .  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});
    
    atomicIntegerArray.lazySet(0,10);
    
    System.out.println(atomicIntegerArray);
  }
}

The code above generates the following result.





















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




AtomicBoolean
AtomicInteger
AtomicIntegerArray
AtomicLong
AtomicLongArray