Here's how to print one-dimensional arrays:
System.out.println(Arrays.toString(arr));
Here's how to print multi-dimensional arrays:
System.out.println(Arrays.deepToString(arr));
In both cases, toString() is called on each element. When the elements of an array are instances of a class that you wrote yourself, make sure to override toString().
Copyright © 2013 Welcome to the website of Davis Fiore. All Rights Reserved.