AtomicIntegerArray length() method in Java with Examples Last Updated : 27 Feb, 2019 Comments Improve Suggest changes Like Article Like Report The Java.util.concurrent.atomic.AtomicIntegerArray.length() is an inbuilt method in Java that returns the length of the AtomicIntegerArray. This method does not accepts any parameter and returns the length of the AtomicIntegerArray which is of type int. Syntax: public final int length() Parameters: The function does not accept any parameter. Return Value: The function returns the length of the AtomicIntegerArray. Below programs illustrate the above method: Program 1: Java // Java program that demonstrates // the length() function import java.util.concurrent.atomic.AtomicIntegerArray; public class GFG { public static void main(String args[]) { // Initializing an array int a[] = { 11, 12, 13, 14, 15 }; // Initializing an AtomicIntegerArray with array a AtomicIntegerArray arr = new AtomicIntegerArray(a); // Displaying the length of the AtomicIntegerArray System.out.println("The length of the array : " + arr.length()); } } Output: The length of the array : 5 Program 2: Java // Java program that demonstrates // the length() function import java.util.concurrent.atomic.AtomicIntegerArray; public class GFG { public static void main(String args[]) { // Initializing an array int a[] = { 11, 12, 13, 14, 15, 16, 17 }; // Initializing an AtomicIntegerArray with array a AtomicIntegerArray arr = new AtomicIntegerArray(a); // Displaying the length of the AtomicIntegerArray System.out.println("The length of the array : " + arr.length()); } } Output: The length of the array : 7 Reference: https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicIntegerArray.html#length() Comment More infoAdvertise with us Next Article AtomicIntegerArray length() method in Java with Examples G gopaldave Follow Improve Article Tags : Java Java-Functions Java-concurrent-package Practice Tags : Java Similar Reads AtomicLongArray length() method in Java with Examples The Java.util.concurrent.atomic.AtomicLongArray.length() is an inbuilt method in Java that returns the length of the AtomicLongArray. This method does not accepts any parameter and returns the length of the AtomicLongArray which is of type int. Syntax: public final int length() Parameters: The funct 2 min read AtomicReferenceArray length() method in Java with Examples The length() method of a AtomicReferenceArray class is used to return the length of this AtomicReferenceArray. Syntax: public final int length() Parameters: This method accepts nothing. Return value: This method returns the integer representing length of this AtomicReferenceArray. Below programs ill 1 min read AtomicIntegerArray get() method in Java with Examples 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. Syntax: public final int get(int i) Parameters: The fun 2 min read AtomicIntegerArray toString() method in Java with Examples The Java.util.concurrent.atomic.AtomicIntegerArray.toString() is an inbuilt method in Java that returns a string that textually represents the current values of the AtomicIntegerArray. The resulting string is a concise and informative representation that is easy for a person to read. It is used to e 2 min read AtomicIntegerArray getAndAdd() method in Java with Examples The Java.util.concurrent.atomic.AtomicIntegerArray.getAndAdd() is an inbuilt method in Java that atomically adds the given value to the element at an index of the AtomicIntegerArray. This method takes the index value of the AtomicIntegerArray and the value to be added as the parameters and returns t 3 min read Like