Here are the comments on the String.compareTo method in the java.lang.String source code:
* Compares two strings lexicographically.
* The comparison is based on the Unicode value of each character in
* the strings. The character sequence represented by this
* <code>String</code> object is compared lexicographically to the
* character sequence represented by the argument string. The result is
* a negative integer if this <code>String</code> object
* lexicographically precedes the argument string. The result is a
* positive integer if this <code>String</code> object lexicographically
* follows the argument string. The result is zero if the strings
* are equal; <code>compareTo</code> returns <code>0</code> exactly when
* the {@link #equals(Object)} method would return <code>true</code>.
------------------
You got a negative integer because 'A' is less than 'a' - the actual code compares two characters and returns :
return c1 - c2;
if the characters are different.
The source code is your friend - if you want to know why something happens in
Java use the source Ricardo!
Bill
[This message has been edited by William Brogden (edited July 01, 2001).]