int[] aa = new int[]{1,2,3,4,5}; int ii = 3; if (Arrays.binarySearch(aa,ii) >= 0) { } 2。在一个list中 List aaList = new ArrayList(); aaList.add(new Integer(0)); aaList.add(new Integer(1)); aaList.add(new Integer(2)); Integer aaInt = new Integer(3); if (aaList.contains(aaInt)) { }