【2.0】基础语法-各种数据类型所占字节和表数范围

1.各种数据类型所占字节数和表数范围

/*整型采用二进制补码存储在计算机中*/
byte  1个字节  (8bit)  -2^7~2^7-1 
short 2个字节 (16bit) -2^16~2^16-1
int 4个字节 (32bit) -2^31~2^31-1
long 8个字节 (64bit) -2^63~2^63-1

/*字符型采用无符号整数存储在计算机中*/
char  2个字节  (16bit) 0~2^16-1         

/*单个布尔型采用int存储,布尔型数组采用byte存储*/
具体参考该博文:http://blog.csdn.net/china_zoujinyong/article/details/8049755

/
*浮点数采用浮点数存储法 float 单精度 double 双精度*/
具体参看该博文:http://blog.csdn.net/zq602316498/article/details/41148063
 
posted @ 2017-04-03 00:02  chxbar  阅读(496)  评论(0编辑  收藏  举报