Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.atomic.AtomicInteger; public class AtomicIntegerGetAndIncrementExp1 { public static void main(String[] args) { AtomicInteger value = new AtomicInteger(); int value1 = value.getAndIncrement(); System.out.println("the updated number: "+ value); System.out.println("the previous number: "+ value1); } }
Output