[Commons]——集合操作
来源:互联网 发布:量身高的软件 编辑:程序博客网 时间:2024/05/29 10:55
public class test4 {//Commons集合操作public static void main(String[] args) {Set<Integer> set1=new HashSet<Integer>();set1.add(1);set1.add(2);set1.add(3);set1.add(4);Set<Integer> set2=new HashSet<Integer>();set2.add(3);set2.add(4);set2.add(5);set2.add(6);//并集Collection<Integer> col=CollectionUtils.union(set1, set2);for(Integer temp:col){System.out.print(temp+" ");}System.out.println();//交集col=CollectionUtils.intersection(set1, set2);//col=CollectionUtils.retainAll(set1, set2);for(Integer temp:col){System.out.print(temp+" ");}System.out.println();//差集col=CollectionUtils.subtract(set2, set1);for(Integer temp:col){System.out.print(temp+" ");}}}
0 0
- [Commons]——集合操作
- [Guava]——集合操作
- Scala集合操作—List
- Scala集合操作—Set
- Scala集合操作—数组
- Scala集合操作—Map
- 操作jQuery集合——搜索操作
- 操作jQuery集合——串联操作
- 操作jQuery集合——过滤操作
- commons集合与队列
- [Commons]——迭代器
- [Commons]——bag
- SE01 Unit04 集合框架 、 集合操作 —— 线性表
- 集合框架 、 集合操作 —— 线性表
- kotlin学习笔记——集合及集合操作符
- 如何在集合中筛选出满足条件的元素——org.apache.commons.collections4的使用
- commons-collections集合类型-MultiMap
- 高级sql学习——集合操作!!!
- 【DP】poj1722
- Android Activity经常被自动回收
- iOS自定义显示30天日历
- win10中启动Genymotion报错
- matlab函数名笔记
- [Commons]——集合操作
- 分类模型的性能评估——以SAS Logistic回归为例(1): 混淆矩阵
- 【dancing links】hust1017
- Chrome 插件JSONView改变风格
- java回炉重造(一)
- Java---设计模块(单例的变形)(多例)
- Android客户端性能优化(魅族资深工程师毫无保留奉献)
- [POJ2104]K-th Number 做题笔记 主席树
- Opengl笔记之函数汇总