Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.atomic.AtomicLong; public class AtomicLongGetAndDecrementExample2 { public static void main (String [] args) { AtomicLong atomiclong = new AtomicLong(10); //Decrements the Initialized value Long result = atomiclong.getAndDecrement(); //Prints the previous value System.out.println("Previous Value : " + result); } }
Output