`

hashset的addAll快忘了

 
阅读更多
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); 
          }             }
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics