Android examples for java.lang:array
Check if an int array contains an integer
import java.lang.reflect.Array; import java.util.List; public class Main{ public static boolean contains(int[] arr, int value) { for (int i = 0; i < arr.length; i++) { if (arr[i] == value) { return true; }//from w ww. j a v a2 s . c o m } return false; } }