Java Collection Intersect sizeOfIntersection(Collection a, Collection b)

Here you can find the source of sizeOfIntersection(Collection a, Collection b)

Description

size Of Intersection

License

Open Source License

Declaration

public static int sizeOfIntersection(Collection<?> a, Collection<?> b) 

Method Source Code

//package com.java2s;

import java.util.Collection;

public class Main {
    public static int sizeOfIntersection(Collection<?> a, Collection<?> b) {
        int count = 0;
        for (Object o : a)
            if (b.contains(o))
                count++;/*  w ww.j  a  va2s .  c  o  m*/
        return count;
    }
}

Related

  1. intersectionSize(Collection c1, Collection c2)
  2. intersects(Collection c1, Collection c2)
  3. intersects(Collection c0, Collection c1)
  4. intersectsWith(Collection S1, Collection S2)
  5. makeIntersection(Collection a, Collection b)