基本数据类型和包装类

int 最大值21亿多,默认值0,integer 默认值null
short 最大值32768
short = (short)int //需要强转
int = short; //不需要强转
int + short = int

int == Integer //true
Integer==Integer // Integer<128:true  Integer>128:false

short + short = int 会转为Int操作,结果为int

short += 1 正确,会隐式强制, short = short+1报错
 

原文地址:https://www.cnblogs.com/xiaolbk/p/11963919.html