AtomicLongArray toString() method in Java with Examples Last Updated : 12 Feb, 2019 Comments Improve Suggest changes Like Article Like Report The Java.util.concurrent.atomic.AtomicLongArray.toString() is an inbuilt method in Java that returns a string that textually represents the current values of the AtomicLongArray. The resulting string is a concise and informative representation that is easy for a person to read. It is used to easily print the contents AtomicLongArray as a string object. Syntax: public String toString() Parameters: The function takes no parameter. Return Value: The function returns the string representation of the current values of AtomicLongArray. Below programs illustrate the above method: Program 1: Java // Java program that demonstrates // the toString() function import java.util.concurrent.atomic.AtomicLongArray; public class GFG { public static void main(String args[]) { // Initializing an array long a[] = { 1, 2, 3, 4, 5 }; // Initializing an AtomicLongArray // with array a AtomicLongArray arr = new AtomicLongArray(a); // Displaying the AtomicLongArray System.out.println("The array : " + arr); // Displaying the string representation // of AtomicLongArray System.out.println("The string representation" + " of the array: " + arr.toString()); } } Output: The array : [1, 2, 3, 4, 5] The string representation of the array: [1, 2, 3, 4, 5] Program 2: Java // Java program that demonstrates // the toString() function import java.util.concurrent.atomic.AtomicLongArray; public class GFG { public static void main(String args[]) { // Initializing an array long a[] = { 11, 12, 13, 14, 15 }; // Initializing an AtomicLongArray // with array a AtomicLongArray arr = new AtomicLongArray(a); // Displaying the AtomicLongArray System.out.println("The array : " + arr); // Displaying the string representation // of AtomicLongArray System.out.println("The string representation" + " of the array: " + arr.toString()); } } Output: The array : [11, 12, 13, 14, 15] The string representation of the array: [11, 12, 13, 14, 15] Reference: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicLongArray.html#toString-- Comment More infoAdvertise with us Next Article AtomicLongArray toString() method in Java with Examples R rupesh_rao Follow Improve Article Tags : Java Java - util package Java-Functions Java-AtomicLongArray Practice Tags : Java Similar Reads AtomicLong toString() method in Java with examples The Java.util.concurrent.atomic.AtomicLong.toString() is an inbuilt method in java that returns the string representation of the current value which is been stored in the AtomicLong. Syntax: public String toString() Parameters: The function does not accepts any parameter. Return value: The function 1 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 AtomicReferenceArray toString() method in Java with Examples The toString() method of a AtomicReferenceArray class is used to return the String representation of the current values of array.This method is used to represent the contents of AtomicReferenceArray as string Syntax: public String toString() Parameters: This method accepts nothing. Return value: Thi 2 min read Class toString() method in Java with Examples The toString() method of java.lang.Class class is used to convert the instance of this Class to a string representation. This method returns the formed string representation. Syntax: public String toString() Parameter: This method does not accept any parameter. Return Value: This method returns the 1 min read Constructor toString() method in Java with Examples The toString() method of java.lang.reflect.Constructor class is used to return string representation of this Constructor.This string is the collection of all the properties of this constructor. For creating this string method adds access modifiers of the constructor with the name of the declaring cl 2 min read Like