These methods returns a string representation of the contents of the specified array. These methods do not recursively go into nested elements

package com.logicbig.example.arrays;
import java.util.Arrays;
public class ToStringExample {
public static void main(String... args) {
Object[] arr1 = {3, 5, 6, 7};
String s1 = arr1.toString();
System.out.println(s1);
String s2 = Arrays.toString(arr1);
System.out.println(s2);
}
}
Output
[Ljava.lang.Object;@606a17d
[3, 5, 6, 7]
For nested array, useArrays#deepToString()

package com.logicbig.example.arrays;
import java.util.Arrays;
public class ToStringExample2 {
public static void main(String... args) {
Object[] arr1 = {3, 5, new Object[]{6, 7, new int[]{9, 11}}};
String s1 = arr1.toString();
System.out.println(s1);
String s2 = Arrays.toString(arr1);
System.out.println(s2);
String s3 = Arrays.deepToString(arr1);
System.out.println(s3);
}
}
Output
[Ljava.lang.Object;@16884b5f
[3, 5, [Ljava.lang.Object;@5a97eed0]
[3, 5, [6, 7, [9, 11]]]