java print arraylist contents code example Example: displaying an arraylist in java Arrays.toString(list.toArray())