// Create the sets
Set set1 = new HashSet();
Set set2 = new HashSet();
set1.add("A");
set2.add("A");
set2.add("B");
// set1=set1+set2-common elements
set1.addAll(set2); // set1=["A","B"]
// set1=set1-set2
set1.removeAll(set2); // set1=[]
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment