import java.util.Arrays;
class first{
public static void main(String[] args){
int arr[]={8,5,8,0,8,6,8,9,10};
int n=Arrays.binarySearch(arr,8);
System.out.println(n);
}
}
Daer sir in the above code i m searching number 8 in specified array but it is returning 4 why? although number 8 is on oth location also.
with regard
Arun kumar maalik
class first{
public static void main(String[] args){
int arr[]={8,5,8,0,8,6,8,9,10};
int n=Arrays.binarySearch(arr,8);
System.out.println(n);
}
}
Daer sir in the above code i m searching number 8 in specified array but it is returning 4 why? although number 8 is on oth location also.
with regard
Arun kumar maalik