一 总括
整型:byte、short、int、long
浮点型:float(单精度)、double(双精度)
字符型:char
布尔型:boolean
二 取值范围
byte :-128~127(2的7次方)
short :-32768~32767(2的15次方)
int :-2147483648~2147483647(2的31次方)
long :-9223372036854774808~9223372036854774807(2的63次方)
float::3.402823e+38~1.401298e-45
double:1.797693e+308~4.9000000e-324
char:
boolean : true ·false
三 占用字符
byte :1
short :2
int :4
long :8
float::4
double:8
char:2
boolean :
四 类型转换
可自动转换的如下所示.
byte :
short :byte
int : byte·short ·char
long :byte·short ·int·char
float::byte·short ·int·long·char
double:byte·short ·int·long·float·char
char:
boolean :
本文详细介绍了编程中的基本数据类型,包括整型(byte,short,int,long),浮点型(float,double),字符型(char)和布尔型(boolean),以及它们的取值范围、占用字符数和类型之间的转换规则。

被折叠的 条评论
为什么被折叠?



