How to copy Set content to another HashSet ? How to copy Set content to another HashSet?

nuevo sistema de citas por internet para visas de no-inmigrante Below example shows how to copy another collection object to HashSet object. By calling addAll() method you can copy another collection to HashSet object.

More Bonuses

elite online dating service package HashSet; import java.util.HashSet; public class HashSetCopy { public static void main(String a[]){ HashSet<String> hs = new HashSet<String>(); //add elements to HashSet hs.add("Selenium"); hs.add("Java"); hs.add("QTP"); System.out.println(hs); HashSet<String> subSet = new HashSet<String>(); subSet.add("Perl"); subSet.add("Ruby"); hs.addAll(subSet); System.out.println("HashSet content after adding another collection:"); System.out.println(hs); } } go Output:
[Java, Selenium, QTP]
HashSet content after adding another collection:
[Java, Perl, Selenium, QTP, Ruby]