AtomicReference
Complete guide to understanding and effectively working with AtomicReference class. Learn the differences among atomic assignment of references in Java, volatile variables and the AtomicReference class.
We'll cover the following...
If you are interviewing, consider buying our number#1 course for Java Multithreading Interviews.
Overview
A reference type is a data type that represents an instance of a Java class, i.e. it is a type other than one of the Java’s primitive types. For instance:
Long myLong = new Long(5);
In the above snippet the variable myLong
represents a reference type. When we create the above object myLong
, Java allocates appropriate memory for the object to be stored. The variable myLong
points to this address in the memory, which stores the object. The address ...