Here you can find the source of arrayContains(T[] src, T target)
public static <T> boolean arrayContains(T[] src, T target)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w . j ava2s . co m*/ * Linear-search implementation, uses {@link CollectionHelper#search(Object[], Object)}. * @return True if target is included in the source array. */ public static <T> boolean arrayContains(T[] src, T target) { return search(src, target) != -1; } /** * Linear-search implementation. */ public static <T> int search(T[] src, T target) { for (int i = 0; i < src.length; i++) { if (src[i].equals(target)) return i; } return -1; } }