Integer数据类型比较
以下是声明java.lang.Integer.compareTo()方法
public int compareTo(Integer anotherInteger)
参数
anotherInteger – 这是对整数进行比较
返回值
此方法如果这个整数是相等于的参数整数返回的值为0,如果这个整数数值小于参数整数则返回小于0的值,如果这个整数数值大于该参数的整数返回一个大于0的值.
Integer数据类型比较
以下是声明java.lang.Integer.compareTo()方法
public int compareTo(Integer anotherInteger)
参数
anotherInteger – 这是对整数进行比较
返回值
此方法如果这个整数是相等于的参数整数返回的值为0,如果这个整数数值小于参数整数则返回小于0的值,如果这个整数数值大于该参数的整数返回一个大于0的值.