The Java.util.concurrent.atomic.AtomicIntegerArray.get() is an inbuilt method in java that gets the current value at any position of the AtomicIntegerArray. This method takes the index value as the parameter and returns the value at this index.
public final int get(int i)
Parameters: The function accepts a single parameter i i.e the value of index to get.
Return value: The function returns the current value at index i.
Below programs illustrate the above method:
The array : [1, 2, 3, 4, 5] Value at index 2 is 3
The array : [12, 22, 23, 24, 25] Value at index 4 is 25
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.