java_数据类型
graph LR;
java数据类型 --> 基本类型
java数据类型 --> 引用类型
1.基本类型
graph LR;
基本类型 --> 数值型
基本类型 --> 字符型("字符型 ( char [ 2字节 ])")
基本类型 --> 布尔型("布尔型 ( boolean [ 1字节 ] 存放true/false)")
数值型 --> 整数("整数( byte [ 1字节 ], short [ 2字节 ], int [ 4字节 ], long [ 8字节字节 ])")
数值型 --> 浮点数("浮点数( float [ 4字节 ], double [ 8字节 ] )")
2.引用类型
graph LR;
引用类型 --> 类("类( class )")
引用类型 --> 接口("接口( interface )")
引用类型 --> 数组("数组( [ ] )")
3.多种类型的数据混合运算
多种类型的数据混合运算时,将以最容量最大的类型运算。
(byte,short)和 char 之间不参与运算转换。
graph LR;
int --> long --> float --> double
char --> int
byte --> short --> int