Here it doesn't make sense to use foreach construct because it instantiates an Iterator but the list is an ArrayList so it is not needed to internally iterate since we have array access for get(int).