Java Vector 二分查找 Java Vector向量最大值1 Java Vector 二分查找2 Java Vector 二分查找 import java.util.Collections; import java.util.Vector; public class Main { public static void main(String[] args) { Vector<String> v = new Vector<String>(); v.add("X"); v.add("M"); v.add("D"); v.add("A"); v.add("O"); Collections.sort(v); System.out.println(v); int index = Collections.binarySearch(v, "D"); System.out.println("Element found at : " + index); } } Java Vector向量最大值1 Java Vector 二分查找2