Java AtomicIntegerArray .addAndGet (int i, int delta)
Syntax
AtomicIntegerArray.addAndGet(int i, int delta) has the following syntax.
public final int addAndGet(int i, int delta)
Example
In the following code shows how to use AtomicIntegerArray.addAndGet(int i, int delta) method.
//from w w w . j a va2 s . c om
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.addAndGet(2,10));
}
}
The code above generates the following result.