package com.joshua317;
public class Main {
public static void main(String[] args) {
//装箱,自动调用Integer.valueOf(100)
Integer a = 100;
//拆箱,自动调用a.intValue()
int b = a;
System.out.println(a==b);
}
}
Java int和Integer的自动装箱与拆箱
阅读 106
2022-04-02
package com.joshua317;
public class Main {
public static void main(String[] args) {
//装箱,自动调用Integer.valueOf(100)
Integer a = 100;
//拆箱,自动调用a.intValue()
int b = a;
System.out.println(a==b);
}
}
相关推荐
精彩评论(0)