可能是因为你这个类型的变量不太对吧,有这个方法么?
public static void main(String[] args) { Integer integer = 1235; System.out.println(integer.compareTo(1222222)); }
你试试这个