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
public String toString()
Parameters: This method accepts nothing.
Return value: This method returns the String representation of the current values of array.
Below programs illustrate the toString() method:
String representation of AtomicReferenceArray: [234, 134, 325, null, null]
String representation of AtomicReferenceArray: [AMAN, AMAR, SURAJ]
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.