摘要:
Set集合: HashSet 随机存储 LinkedHashSet 存取顺序一致 TreeSet HashSet: boolean b1 = hs.add("a"); //存取成功返回true,不成功返回false(有重复值时存取不成功!) 存储自定义对象,并保证元素唯一性:需要在自定义对象中重写h 阅读全文
posted @ 2016-08-17 19:18
迷失de
阅读(180)
评论(0)
推荐(0)
摘要:
ArrayList去除集合中字符串的重复值 public static ArrayList getSingle(ArrayList list) { ArrayList newList = new ArrayList(); //创建一个新集合 Iterator it = list.iterator() 阅读全文
posted @ 2016-08-17 18:54
迷失de
阅读(143)
评论(0)
推荐(0)
浙公网安备 33010602011771号