类型优先级
byte,short,char<int<long<float<double;
其中byte short char之间均需要强制转换才可以,其他从低到高自动转换,高到低需要强制转换
所用字节分别为
byte 1字节
short 2字节
char 2字节 (C语言中为1字节)
int 4字节
long 8字节
float 4字节
double 8字节
类型优先级
byte,short,char<int<long<float<double;
其中byte short char之间均需要强制转换才可以,其他从低到高自动转换,高到低需要强制转换
所用字节分别为
byte 1字节
short 2字节
char 2字节 (C语言中为1字节)
int 4字节
long 8字节
float 4字节
double 8字节