![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JAVA
weixin_37712040
发的萨芬撒地方撒地方撒发斯蒂芬撒的发斯蒂芬大三
展开
-
数组/List集合判断是否有交集--retainAll()
1.数组转为List集合 Arrays.asList(postCodeOld.split(",")) 2.List集合转为HashSet集合 HashSet<String> set = new HashSet<String>(Arrays.asList(postCodeOld.split(","))); 3. H...原创 2018-12-05 21:00:46 · 8932 阅读 · 0 评论 -
判断一个集合/数组中是否有重复元素(JDK1.7及以下版本)
1.如果是数组转为List集合 List<String> lists = Arrays.asList( String[] ); 2.利用Set集合无序不可重复的特性 1>新建一个set集合 Set<String> set = new HashSet<String>(); 2.循环往这个set集...原创 2018-12-07 10:38:09 · 879 阅读 · 0 评论