fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. HashSet<Integer> set1 = new HashSet<Integer>();
  9.  
  10. set1.add(2);
  11. set1.add(4);
  12.  
  13. set1.add(8);
  14. set1.add(9);
  15. HashSet<Integer> set2 = new HashSet<Integer>();
  16. set2.add(2);
  17. set2.add(6);
  18. set2.add(8);
  19. set2.add(9);
  20. HashSet<Integer> set3 = new HashSet<Integer>();
  21. set3.add(2);
  22. set3.add(4);
  23. set3.add(8);
  24. set3.add(9);
  25. set1.removeAll(set2);
  26. set1.removeAll(set3);
  27. System.out.println(set1);
  28. }
  29. }
Success #stdin #stdout 0.03s 245632KB
stdin
Standard input is empty
stdout
[]