由于ArrayList只能使用引用类型,不能使用基本类型,所以,为了使ArrayList也能使用基本类型数据,因此,这里需要引入包装类的概念。
注:ArrayList不能使用基本数据类型的原因是,基本数据类型无存储地址
包装类:
byte Byte
short Short
int Integer
long Long
float Float
double Double
char Character
boolean Boolean
以整型类Integer为例:
自jdk1.5+开始,支持自动装箱,自动拆箱。
啥意思?我也不懂
原文:https://www.cnblogs.com/wucancan/p/12896008.html