Java AtomicLongArray .decrementAndGet (int i)

Syntax

AtomicLongArray.decrementAndGet(int i) has the following syntax.

public final long decrementAndGet(int i)

Example

In the following code shows how to use AtomicLongArray.decrementAndGet(int i) method.


import java.util.concurrent.atomic.AtomicLongArray;
//from  w w  w . j a v  a2 s. c  om
public class Main {
  public static void main(String[] argv) throws Exception {
    AtomicLongArray atomicLongArray = new AtomicLongArray(10);
    System.out.println(atomicLongArray.decrementAndGet(2));
    System.out.println(atomicLongArray);
  }
}

The code above generates the following result.





















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




AtomicBoolean
AtomicInteger
AtomicIntegerArray
AtomicLong
AtomicLongArray