检查数组是否包含元素的泛型方法
//package com.book2s; public class Main { /* n o w j a v a . c o m 提供 */ public static <T> boolean contains(T[] array, T value) { final Class<?> componetType = array.getClass().getComponentType(); boolean isPrimitive = false; if (null != componetType) { isPrimitive = componetType.isPrimitive(); } for (T t : array) { if (t == value) { /* from n o w j a v a . c o m - 时代Java*/ return true; } else if (false == isPrimitive && null != value