From b981bfc880e6f4e9ae5c516e0809968d8731e0c4 Mon Sep 17 00:00:00 2001 From: jtd00123 Date: Sat, 20 Aug 2016 17:49:23 -0400 Subject: [PATCH] Update App.java Added additional explanation on retainAll() and removeAll() methods. --- 55 - Sets/src/App.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/55 - Sets/src/App.java b/55 - Sets/src/App.java index 6480617..abddb29 100644 --- a/55 - Sets/src/App.java +++ b/55 - Sets/src/App.java @@ -61,18 +61,18 @@ public static void main(String[] args) { ////////////// Intersection /////////////////// - Set intersection = new HashSet(set1); + Set intersection = new HashSet(set1); - intersection.retainAll(set2); + intersection.retainAll(set2); // keeps similarities between set 1 and set 2 System.out.println(intersection); ////////////// Difference ///////////////////////// - Set difference = new HashSet(set2); + Set difference = new HashSet(set2); - difference.removeAll(set1); + difference.removeAll(set1); // removes differences between set1 and set2, prints what is left of set2 System.out.println(difference); } -} \ No newline at end of file +}