62,621
社区成员
发帖
与我相关
我的任务
分享
String[] colors =
{"blue", "red", "green", "yellow", "orange"};
Arrays.sort(colors);//此时数组为blue,green,orange,red,yellow
int s2 = Arrays.binarySearch(colors, "orange");
int s3 = Arrays.binarySearch(colors, "violet");
System.out.print(s2 + "" + s3);