Here is the code am trying to execute., Obvious on the code returning a -negative value, But any reason why is it returning -7?? I vaguely understand it is based on the length of the arrary, but can someone explain more., Thanks for your help.
public class FindNumberFromBinary {
String myBubbleStr[] = {"Zoon","Hello","World", "Yep", "Yow", "MyData"};
public String findString() {
System.out.println(Arrays.binarySearch(myBubbleStr, "yow"));
return "";
}
public static void main(String args[]){
FindNumberFromBinary fnb= new FindNumberFromBinary();
fnb.findString();
}
}