目录 一、Collection接口 二、Iterator接口 1、Iterator接口方法 2、遍历 3、forEach 4、遍历元素的顺序取决于集合类型 三、Java集合 大家好,我是哪吒。 一、Collection接口 在Java类库中,集合类的基类是Collection接口。 boolean add(E e):向集合中添加一个元素; boolean addAll(