java Collections工具类使用总结(疯狂java讲义读书笔记)

来源:互联网 发布:057188158198是淘宝吗 编辑:程序博客网 时间:2024/06/06 01:34

1.排序操作

这里写图片描述
这里写图片描述
这里写图片描述
这里写图片描述


2.查找,替换操作

这里写图片描述
这里写图片描述
这里写图片描述
这里写图片描述


3.同步控制

Collection c=Collections.synchronizedCollection(new ArrayList());List list=Collections.synchronizedList(new ArrayList());Set set=Collections.synchronizedSet(new HashSet());Map map=Collections.synchronizedMap(new HashMap());

4.设置不可变集合
Collections提供了一个方法,返回一个集合的不可变版本。
这里写图片描述

原创粉丝点击