Here you can find the source of Search(int[] in, int val)
public static final int Search(int[] in, int val)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static final int Search(int[] in, int val, boolean sort) { if (sort) Sort(in);//from w w w. jav a 2 s.c o m return Arrays.binarySearch(in, val); } public static final int Search(int[] in, int val) { return Search(in, val, true); } public static final void Sort(int[] in) { Arrays.sort(in); } }