当容量小的数据类型的变量与容量大的数据类型的变量做运算时,结果自动提升为容量大的数据类型。
byte、char、short-->int-->long-->float-->double
byte,char,short 这三者相互运算的时候结果都为int
char c1 = 'a';//a=97
int i3 = 10;
int i4 = c1+i3;//编译通过
short s2 =10;
//char c2 = c1+s2;编译不通过,报错possible lossy convertion from int to char