1.1自动装箱

int t1=2;
Integer t2 =t1;

1.2手动装箱

Integer t3 = new Integer(t1);

2、拆箱:把包装类转换成基本数据类型

2.1自动拆箱

int t4=t2;

2.2手动拆箱

int t5 = t2.intValue();

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2021-12-02
  • 2021-07-30
  • 2022-12-23
  • 2021-06-21
  • 2021-11-02
猜你喜欢
  • 2022-12-23
  • 2022-02-08
  • 2022-01-17
  • 2021-04-01
  • 2021-09-19
  • 2021-09-05
相关资源
相似解决方案