The getAcquire() method of a AtomicReference class is used to return the value of this AtomicReference object with memory ordering effects on geting variable is compatible with memory_order_acquire ordering.
public final V getAcquire()
Parameters: This method accepts nothing.
Return value: This method returns current value of this AtomicReference object with memory ordering effects.
Below programs illustrate the get() method:
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.