how to print an arraylist as a string in java code example Example: how to print arraylist Arrays.toString(list.toArray())