在使用Arrays.binarySearch()的时候要注意先对数组进行排序. Arrays.binarySearch()方法介绍: Searches the specified array of ints for the specified value using the binary search algorithm. The array must be sorted (as by the sort(int[]) method) prior to making this call. If i…