how to get one output from arraylist java code example Example: displaying an arraylist in java Arrays.toString(list.toArray())