AtomicReferenceArray get() method in Java with Examples
The get() method of a AtomicReferenceArray class is used to return the value of the element at index i for this AtomicReferenceArray object with memory semantics of reading as if the variable of index was declared volatile type of variable.
public final E get(int i)
Parameters: This method accepts the index i to get the value.
Return value: This method returns current value at index i.
Below programs illustrate the get() method:
value at 0 = 12 value at 1 = 13 value at 2 = 14 value at 3 = 15
value at 0 = AMAN value at 1 = AMAR
My Personal Notes arrow_drop_up
Please Login to comment...