zoukankan      html  css  js  c++  java
  • Java 包装类Integer的值比较

    对于包装类型Integer的值比较与int的值比较是不同的;

    public class Java_Val_Compare {
    
        public static void main(String[] args) {
            Integer a1 = 127;
            Integer a2 = 127;
            System.out.println("a1==a2?:	"+(a1==a2));
            
            Integer b1 = 128;
            Integer b2 = 128;
            System.out.println("b1==b2?:	"+(b1==b2));
        
            System.out.println("b1.intValue()==b2.intValue()?:	"
            +(b1.intValue()==b2.intValue()));
        }
    }

    执行结果:

  • 相关阅读:
    Git Bash关键命令
    一个不需要Log4Net的写日志的简单方法
    未知软件
    Linux
    Linux
    Linux
    Linux
    Linux
    Linux
    Linux
  • 原文地址:https://www.cnblogs.com/zhengwenqiang/p/7508995.html
Copyright © 2011-2022 走看看