int和Integer有什么区别

Java 提供两种不同的类型:引用类型和原始类型(或内置类型)。Int是java的原始数据类型,Integer是java为int提供的封装类。Java为每个原始类型提供了封装类。

原始类型   封装类
boolean  Boolean
char       Character
byte       Byte
short      Short
int          Integer
long       Long
float       Float
double    Double

国泰民安
原文地址:https://www.cnblogs.com/jirglt/p/2551433.html