複製鏈接
請複製以下鏈接發送給好友

compareTo

鎖定
public int compareTo(IntegeranotherInteger)在數字上比較兩個Integer對象。
外文名
compareTo
參    數
anotherInteger - 要比較的 Integer

compareTo指定者

接口 Comparable<Integer> 中的 compareTo

compareTo參數

anotherInteger - 要比較的 Integer。

compareTo返回值

如果該 Integer 等於 Integer 參數,則返回 0 值;如果該 Integer 在數字上小於 Integer 參數,則返回值-1;如果 Integer 在數字上大於 Integer 參數,則返回整數1。

compareTo版本開始

1.2