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