public class inte {
public static void main(String[] args){
Integer a = new Integer("3");
Integer b = new Integer(3);
Integer c = new Integer("30");
System.out.println(a==b); //false
System.out.println(a.equals(b)); //true
System.out.println(a.compareTo(c)); //-1
}
}
Integer对象比较
最新推荐文章于 2021-12-27 16:11:20 发布