关于Integer.valueOf()从缓存池取对象的用法
package com.xiaoa;/**
* @Auther: xiaoa
* @Date: 2018.10.5 09:51
* @Description:关于Integer.valueOf()从缓存池取对象的用法
*/
public class TestInteger {
public static void main(String[] args) {
final Integer a = new Integer(55);
final Integer b = new Integer(55);
System.out.println(a == b);
final Integer c = Integer.valueOf(55);
System.out.println(a == c);
final Integer d = Integer.valueOf(55);
System.out.println(c == d);
}
}