Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.atomic.AtomicLong; public class AtomicLongAddandGetExample1 { public static void main (String [] args) { AtomicLong atomiclong = new AtomicLong(); //adds this number to the Initialized value Long result = atomiclong.addAndGet(10); //Prints the added value after addition to the Initialized value System.out.println(result); } }
Output