遍历集合方式: public static void main(String[] args) {List<Object> arrayList = new ArrayList<>();arrayList.add(1);arrayList.add(3);arrayList.add(111);Iterator<Object> iterator = arrayList.iterator();while (iterator.hasNext()){System.out.println(iterator.next());}} arraylist底层原理 hashset