Integer对象比较

来源:互联网 发布:linux 给用户root权限 编辑:程序博客网 时间:2024/05/17 19:18
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);    //falseSystem.out.println(a.equals(b));   //trueSystem.out.println(a.compareTo(c));    //-1}}

0 0
原创粉丝点击