Java Set Difference difference(Set a, Set b)

Here you can find the source of difference(Set a, Set b)

Description

difference

License

Open Source License

Declaration

public static Set difference(Set a, Set b) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static Set difference(Set a, Set b) {
        Set temp = new HashSet();
        temp.addAll(a);/*w  w  w  .  j a v a2  s.c  o  m*/
        temp.removeAll(b);
        return temp;
    }
}

Related

  1. computeDifference(Set a, Set b, String prefix, boolean exactMatch)
  2. diffAbyB(Set setA, Set setB)
  3. difference(final Set set1, final Set set2)
  4. difference(final Set first, final Set second)
  5. difference(Set first, Set second)
  6. difference(Set s1, Set s2)
  7. difference(Set setA, Set setB)