Integer类的缓存机制

时间:2020-12-21 04:33:02
【文件属性】:
文件名称:Integer类的缓存机制
文件大小:47KB
文件格式:PDF
更新时间:2020-12-21 04:33:02
te 缓存 存在下述例子,判断其输出结果。 public class Main{ public static void main(String[] agrs){ Integer a = 110; Integer b = 110; Integer c = 150; Integer d = 150; System.out.println("a == b: " + (a == b)); System.out.println("c == d: " + (c == d)); } } 我们知道,在Java中存在基本数据类型和引用数据类型,而Integer作为int的封装类,Integer

网友评论