title: When to use AtomicReference in Java?
body: <p>When do we use <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/atomic/AtomicReference.html" rel="noreferrer"><code>AtomicReference</code></a>?</p>
  
  <p>Is it needed to create objects in all multithreaded programs?</p>
  
  <p>Provide a simple example where AtomicReference should be used.</p>