Hi
This is my first post in this forum.
Source:Ethumare
import java.util.*;
public class TestClass
{
static
String[] sa = { "a", "aa", "aaa", "aaaa"};
static
{
Arrays.sort(sa);
}
public static void main(String[] args)
{
String search = "";
if(args.length != 0) search = args[0];
System.out.println(Arrays.binarySearch(sa, search));
}
}
Here the search is applied on "".O/p should be -1.I have tried i am getting -1.
But the source is saying
Any number from -5 to 3;
Thanks
[ May 30, 2007: Message edited by: Narsingh Rao ]
[ May 30, 2007: Message edited by: Narsingh Rao ]