阅读jdk源码,可以发现,对于基本类型的包装类,是有静态缓存。
1、对Boolean类型,true和false都有对应的缓存,源码为:
/** * The { @code Boolean} object corresponding to the primitive * value { @code true}. */ public static final Boolean TRUE = new Boolean(true); /** * The { @code Boolean} object corresponding to the primitive * value {