AtomicReference getAndSet() method in Java with Examples
The getAndSet() method of a AtomicReference class is used to atomically sets the value of AtomicReference object to newValue which is passed as parameter and returns the old value of the AtomicReference object, with memory effects as specified by VarHandle.getAndSet(java.lang.Object...).VarHandle.ge