Java集合-案例

1、ArrayList集合中,contains重写:

2、Vector使用枚举遍历集合

3、List集合特有的迭代器

4、HashSet集合,存储自定义数据类型,要求重写hashCode()和equals()方法

 

5、TreeSet集合存储自定义数据类型,重写比较

comparable接口:comparaTo方法:

Comparator接口:

6、Collections工具类:

7、遍历Map集合:

1、

2、

原文地址:https://www.cnblogs.com/AlbertY/p/9425530.html