Java tutorial
import java.util.Arrays; public class Main { public static void main(String[] args) { // initializing sorted short array short shortArr[] = { 1, 2, 15, 52, 110 }; // value to search short searchVal = 15; int retVal = Arrays.binarySearch(shortArr, searchVal); System.out.println("The index of element 15 is : " + retVal); } }