java.util.Arrays中的这些方法对你或许有用
static int binarySearch(byte[] a, byte key)
Searches the specified array of bytes for the specified value using the binary search algorithm.
static int binarySearch(char[] a, char key)
Searches the specified array of chars for the specified value using the binary search algorithm.
static int binarySearch(double[] a, double key)
Searches the specified array of doubles for the specified value using the binary search algorithm.
........其他类似
static int binarySearch(byte[] a, byte key)
Searches the specified array of bytes for the specified value using the binary search algorithm.
static int binarySearch(char[] a, char key)
Searches the specified array of chars for the specified value using the binary search algorithm.
static int binarySearch(double[] a, double key)
Searches the specified array of doubles for the specified value using the binary search algorithm.
........其他类似
讲的很好啊!
或者你就丛数组new一个Vector出来。效率肯定不高,但是可以少些几行代码,可读性也好一点点