Java Arrays 二分查找 Long 索引 Java Arrays 二分查找 Long Java Arrays 二分查找对象 Java Arrays 二分查找 Long 索引 package com.codingdict; import java.util.Arrays; public class ArrayDemo { public static void main(String[] args) { // initializing unsorted long array long longArr[] = {56,46464,3342,232,3445}; // sorting array Arrays.sort(longArr); // let us print all the elements available in list System.out.println("The sorted long array is:"); for (long number : longArr) { System.out.println("Number = " + number); } // entering the value to be searched long searchVal = 232; // entering range of index int retVal = Arrays.binarySearch(longArr,1,2,searchVal); System.out.println("The index of element 232 is : " + retVal); } } Java Arrays 二分查找 Long Java Arrays 二分查找对象