1.Boolean数据类型不可以转换为其他的类型
2.默认转换规则:
byte -> short ->int->long->float->double
byte,short,char相互之间转换,任何两者参与运算首先转为Int类型
3.强制转换:
目标类型 变量名 = (目标类型)(需要转换的数据)
JAVA的数据类型的转换
最新推荐文章于 2024-07-15 22:27:12 发布
1.Boolean数据类型不可以转换为其他的类型
2.默认转换规则:
byte -> short ->int->long->float->double
byte,short,char相互之间转换,任何两者参与运算首先转为Int类型
3.强制转换:
目标类型 变量名 = (目标类型)(需要转换的数据)