how-to

Arrays

How to quickly write array elements

For quickly writing array elements use class java.util.Arrays. That 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]