看下这个类的源代码不就知道了

解决方案 »

  1.   

    Compares two strings lexicographically. The comparison is based on the Unicode value of each character in the strings. The character sequence represented by this String object is compared lexicographically to the character sequence represented by the argument string. The result is a negative integer if this String object lexicographically precedes the argument string. The result is a positive integer if this String object lexicographically follows the argument string. The result is zero if the strings are equal; compareTo returns 0 exactly when the equals(Object) method would return true.一开始的时候我也被这家伙迷糊了,后面看了帮助文档才发现原来这货用的竟然是String.compareTo();也就是简单的比较Unicode值而已了................