posted 14 years ago
In compareto(object 1,obect 2) and compare() method the object ar comapared and returned -ve,0 and +ve values based on the comparision --- if object1 is greater than object 2 return 0,my question in what sense the object ar compared as greater or smaller?is it the no. of characters counted and compared?
ex-obj1 let be "fun"
and obj2 let be "hello" then if we compare this two object by using overriding of
compare(obj1,obj2)
{
return obj1.compareTo(obj2);
}
how i can preddict wether it is -1,1 or zero?