Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.atomic.AtomicLong; public class AtomicLongIncrementAndGetExample3 { public static void main (String [] args) { AtomicLong atomiclong = new AtomicLong(-20); //Increments the Initialized value Long result = atomiclong.incrementAndGet(); //Prints the updated value System.out.println("Updated Value : " + result); } }
Output