There are two TreeSets in my app:
TreeSet
set1 = {501,502,503,504} set2 = {502,503,504,505}
I want to get the symmetric difference of thes
Set s1 = new HashSet(); Set s2 = new HashSet(); s1.add("a"); s1.add("b"); s2.add("b"); s2.add("c"); Set s3 = new HashSet(s1); s1.removeAll(s2); s2.removeAll(s3); s1.addAll(s2); System.out.println(s1);
output of s1 : [a,c]