Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.atomic.AtomicLong; public class AtomicLongAddandGetExample2 { public static void main (String [] args) { AtomicLong atomiclong = new AtomicLong(10); //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