java arraylist print all elements suing loop code example Example: displaying an arraylist in java Arrays.toString(list.toArray())