AtomicInteger.getAndDecrement() has the following syntax.
public final int getAndDecrement()
In the following code shows how to use AtomicInteger.getAndDecrement() method.
import java.util.concurrent.atomic.AtomicInteger; public class Main { public static void main(String[] argv) throws Exception { AtomicInteger atomicInteger = new AtomicInteger(); System.out.println(atomicInteger.getAndDecrement()); } }
The code above generates the following result.