public static void main(String[] args) { HashSet a=new HashSet(); a.add("1"); HashSet B=new HashSet(); B.add("2"); HashSet C=new HashSet(); C.addAll(a); C.addAll(B); Iterator i = C.iterator(); while(i.hasNext()){ String temp = (String)i.next(); System.out.println(temp); } }
hashset的addAll快忘了
猜你喜欢
转载自love398146779.iteye.com/blog/1569070
今日推荐
周排行