This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
    Bookmark Topic Watch Topic
  • New Topic

How to merge 2 hashsets into 1 hashset?  RSS feed

 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Report post to moderator
How to merge 2 hashsets into 1 hashset?

I tried doing this but seems it is not working. please help!
if(emails.addAll(emails2)){
emails3=emails;
}
else{
System.out.println("! all emails not added");
}

try{
for(Iterator iter=emails3.iterator(); iter.hasNext() {
to =(String)(iter.next());
System.out.println("inside iterator for emails3 the to got is:"+to);
}
...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please continue any discussion of this topic here.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!