Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.atomic.AtomicInteger; public class AtomicIntegerAddAndGetExp3 { 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(-200); return (number1); } }
Output