Here you can find the source of intersectArrays(int[] targetArray, int[] selfArray)
private static boolean intersectArrays(int[] targetArray, int[] selfArray)
//package com.java2s; public class Main { private static boolean intersectArrays(int[] targetArray, int[] selfArray) { for (int i : targetArray) { for (int j : selfArray) { if (i == j) { return true; }/*from www. j a va2s . co m*/ } } return false; } }