Thursday, November 23, 2017

JAVA - How to quickly list (all) array elements

For quickly list array elements use class java.util.Arrays. This class contains static methods for work with arrays.
String[] array = new String[3];

array[0] = "One";
array[1] = "Two";
array[2] = "Three";

System.out.println( Arrays.toString( array ) );
The output is:
[One, Two, Three]

No comments:

Post a Comment