Java tutorial
import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { public static void main(String args[]) { List<String> arlst = new ArrayList<String>(); arlst.add("CSS"); arlst.add("HTML"); arlst.add("PHP"); // search the list for key int index = Collections.binarySearch(arlst, "HTML"); System.out.println(index); } }