displaying an arraylist in java

Java
Arrays.toString(list.toArray())
Source

Also in Java: