how to output a list java code example Example: how to print list contents in java System.out.println(Arrays.toString(list.toArray()));