Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.atomic.AtomicInteger; public class AtomicIntegerAddAndGetExp5 { public static void main(String[] args) { System.out.println("when initial value is -100: "+addAndGet()); } public static int addAndGet() { AtomicInteger number= new AtomicInteger(-100); int number1=number.addAndGet(-100); return (number1); } }
Output