Java List Intersect Intersection(List a, List b)

Here you can find the source of Intersection(List a, List b)

Description

Intersection

License

Apache License

Declaration

private static List<Integer> Intersection(List<Integer> a,
            List<Integer> b) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;

import java.util.List;

public class Main {
    private static List<Integer> Intersection(List<Integer> a,
            List<Integer> b) {
        // TODO Auto-generated method stub
        List<Integer> C = new ArrayList<Integer>();
        for (Integer i : a) {
            if (b.contains(i)) {
                C.add(i);/* ww w  . jav a2 s  . com*/
            }
        }
        return C;
    }
}

Related

  1. intersection(final List list1, final List list2)
  2. intersection(final List list1, final List list2)
  3. intersection(List> sets)
  4. intersection(List list1, List list2)
  5. intersection(List list1, List list2)
  6. intersection(List list1, List list2)
  7. intersection(List arrayOne, List arrayTwo)
  8. intersection(List listOne, List listTwo)
  9. intersection(List set1, List set2)