Example usage for java.util.concurrent.atomic AtomicLong intValue

List of usage examples for java.util.concurrent.atomic AtomicLong intValue

Introduction

In this page you can find the example usage for java.util.concurrent.atomic AtomicLong intValue.

Prototype

public int intValue() 

Source Link

Document

Returns the current value of this AtomicLong as an int after a narrowing primitive conversion, with memory effects as specified by VarHandle#getVolatile .

Usage

From source file:Main.java

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

    System.out.println(nextId.getAndIncrement());
    System.out.println(nextId.intValue());
}