Java Arrays 二分查找 Short Java Arrays 二分查找 Short 索引 Java Arrays 二分查找 Super 索引 Java Arrays 二分查找 Short package com.codingdict; import java.util.Arrays; public class ArrayDemo { public static void main(String[] args) { // initializing unsorted short array short shortArr[] = {5,2,15,52,10}; // sorting array Arrays.sort(shortArr); // let us print all the elements available in list System.out.println("The sorted short array is:"); for (short number : shortArr) { System.out.println("Number = " + number); } // entering the value to be searched short searchVal = 15; int retVal = Arrays.binarySearch(shortArr,searchVal); System.out.println("The index of element 15 is : " + retVal); } } Java Arrays 二分查找 Short 索引 Java Arrays 二分查找 Super 索引