Here you can find the source of inArray(int[] arr, int search)
public static boolean inArray(int[] arr, int search)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean inArray(int[] arr, int search) { if (arr != null) { for (int i = 0; i < arr.length; i++) { if (arr[i] == search) { return true; }// ww w . j a v a 2s. c o m } } return false; } public static boolean inArray(int[] arr, int[] search) { if (search != null) { for (int i = 0; i < search.length; i++) { if (!inArray(arr, search[i])) { return false; } } return true; } return false; } public static boolean inArray(char[] arr, char search) { if (arr != null) { for (int i = 0; i < arr.length; i++) { if (arr[i] == search) { return true; } } } return false; } public static boolean inArray(char[] arr, char[] search) { if (search != null) { for (int i = 0; i < search.length; i++) { if (!inArray(arr, search[i])) { return false; } } return true; } return false; } public static boolean inArray(byte[] arr, byte search) { if (arr != null) { for (int i = 0; i < arr.length; i++) { if (arr[i] == search) { return true; } } } return false; } public static boolean inArray(byte[] arr, byte[] search) { if (search != null) { for (int i = 0; i < search.length; i++) { if (!inArray(arr, search[i])) { return false; } } return true; } return false; } public static boolean inArray(Object[] arr, Object search) { if (arr != null && search != null) { for (int i = 0; i < arr.length; i++) { if (search.equals(arr[i])) { return true; } } } return false; } public static boolean inArray(Object[] arr, Object[] search) { if (search != null) { for (int i = 0; i < search.length; i++) { if (!inArray(arr, search[i])) { return false; } } return true; } return false; } public static boolean inArray(String[] arr, String search) { if (arr != null && search != null) { for (int i = 0; i < arr.length; i++) { if (search.equals(arr[i])) { return true; } } } return false; } public static boolean inArray(String[] arr, String[] search) { if (search != null) { for (int i = 0; i < search.length; i++) { if (!inArray(arr, search[i])) { return false; } } return true; } return false; } }