Java 包装类

  

 

 

 

Boolean

 

 

 

 

Character

 

 

 

 

 

Number

 

 

 

 

 

 

 

 

 

手动装箱

 

 

 

 第一种 构造器 手动装箱方法 Deprecated , 会产生不同的 Integer对象 , 提倡 使用 static factory Integer.valueOf()

 

 

 

 

手动拆箱

 

 

自动装箱

 

 

底层调用Integer.valueOf()

 

自动拆箱

 

 

底层调用intValue方法

 

 

 

 

 

 

 

 

 

 

 

posted @ 2021-07-10 22:34  ascertain  阅读(46)  评论(0)    收藏  举报