Ad Steps 1 Use the static method Arrays.toString(array) to get a string representation of one dimensional arrays. Ad 2 Use the static method Arrays.deepToString(array) for arrays within arrays and multidimensional arrays. Method 2 of 3: Java 1.4 1 Use the static method Arrays.asList() to get a printable list representation of the array and use it with println() 2 Use the standard library static method Arrays.toString() for one dimensional arrays. 3 Use a combination of Arrays.toString, for loops and string concatenation to get the string representation of a multidimensional array.
Read full article from 3 Ways to Print an Array in Java - wikiHow
No comments:
Post a Comment