Java基础知识回顾-19(Collect接口,Iterator迭代器与增强for循环)

1、集合是java中提供的一种容器,可以用来存储多个数据。

2、ArrayList继承了抽象类Collection的同时,实现了接口list,同时List接口又继承了Collection接口。

3、Collection和List,ArrayList的关系

4、Collection接口的基本方法

5、用Collection创造集合的方法

Collection<元素类型变量名 = new ArrayList<元素类型>();      //这是将ArrayList多态为Collection类型,

猜你喜欢

转载自www.cnblogs.com/zhangrui0328/p/9099760.html