> one would think, but it might depend on how the underlying code is written.
> When a string object is created--if I were writing the object--it'd do some
> kind of check sum with xor or something like that to offer some kind of
> numeric identity for the string which would make string compare as fast as
> int compare because it would be an int compare. 

That's the principle of String.hashCode()  - to generate a
pseudo-unique number based on the string.

> If the compare gets slower according
> to the length of the string, bad on java guys. 

For long strings of the same length, no matter what your hash
function, you'll have to compare them character-by-character to see if
they're really the same - because the hash code can't be guaranteed to
be unique for only that String.

Jim

_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to