public int compareTo ( Integer anotherInteger )在数字上比较两个 Integer 对象。
Defines a co-variant version of the equals() or compareTo() method.
定义一个 co-variant 版本的 equals() 或 compareTo() 方法。
One of the implications of erasure is that a class cannot implement both Comparable and Comparable, because both of these are in fact the same interface, specifying the same compareTo() method.
擦除意味着一个类不能同时实现 Comparable和 Comparable,因为事实上两者都在同一个接口中,指定同一个 compareTo()方法。
应用推荐