Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.atomic.AtomicInteger; public class AtomicIntegerWeakCompareAndSetExp5 { @SuppressWarnings("deprecation") public static void main(String[] args) { AtomicInteger value = new AtomicInteger(-100); value.weakCompareAndSet(-10, 1); System.out.println("the new value is: "+value); } }
Output