Java examples for Collection Framework:Array Contain
Generic method to check if an Item in ArrayList
//package com.java2s; import java.util.ArrayList; public class Main { public static <T> boolean inArrayList(ArrayList<? extends T> array, T other) {//from w w w . j a v a 2 s. com for (T object : array) { if (object.equals(other)) { return true; } } return false; } }