Java List Intersect hasIntersection(List list1, List list2)

Here you can find the source of hasIntersection(List list1, List list2)

Description

has Intersection

License

Open Source License

Declaration

public static boolean hasIntersection(List<String> list1, List<String> list2) 

Method Source Code

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

import java.util.List;

public class Main {
    public static boolean hasIntersection(List<String> list1, List<String> list2) {
        for (String str : list1)
            if (list2.contains(str))
                return true;
        return false;

    }//from ww w  .  jav  a2s  .  c o  m
}

Related

  1. calculauteIntersection(Set wordList1, Set wordList2)
  2. getIntersection( final List... collectionOfIDLists)
  3. getIntersection(List list1, List list2)
  4. getIntersection(String[] list1, String[] list2)
  5. getIntersectionOfLineAndSegments(double x1, double y1, double x2, double y2, List segmentPoints)
  6. hasIntersection(Set set, List list)
  7. Intersect(List A, List B)
  8. intersect(List ls, List ls2)
  9. intersect(List lst1, List lst2)