Java AtomicLong.longValue()

Syntax

AtomicLong.longValue() has the following syntax.

public long longValue()

Example

In the following code shows how to use AtomicLong.longValue() method.


/*from ww  w. ja  v  a2 s  . c o  m*/
import java.util.concurrent.atomic.AtomicLong;

public class Main {
  public static void main(String[] argv) {
    AtomicLong nextId = new AtomicLong();

    System.out.println(nextId.longValue());
  }
}

The code above generates the following result.





















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




AtomicBoolean
AtomicInteger
AtomicIntegerArray
AtomicLong
AtomicLongArray