We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 92f3540 commit b981bfcCopy full SHA for b981bfc
1 file changed
55 - Sets/src/App.java
@@ -61,18 +61,18 @@ public static void main(String[] args) {
61
62
////////////// Intersection ///////////////////
63
64
- Set<String> intersection = new HashSet<String>(set1);
+ Set<String> intersection = new HashSet<String>(set1);
65
66
- intersection.retainAll(set2);
+ intersection.retainAll(set2); // keeps similarities between set 1 and set 2
67
68
System.out.println(intersection);
69
70
////////////// Difference /////////////////////////
71
72
- Set<String> difference = new HashSet<String>(set2);
+ Set<String> difference = new HashSet<String>(set2);
73
74
- difference.removeAll(set1);
+ difference.removeAll(set1); // removes differences between set1 and set2, prints what is left of set2
75
System.out.println(difference);
76
}
77
78
-}
+}
0 commit comments