Java tutorial
import java.util.Arrays; public class Main { public static void main(String[] args) { // initializing sorted byte array byte byteArr[] = { 10, 20, 22, 35, 66 }; // the value to be searched byte searchVal = 35; int retVal = Arrays.binarySearch(byteArr, searchVal); System.out.println("The index of element 35 is : " + retVal); } }