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