java 基本数据类型

1、八种数据类型,位数从小到大:

单精度:

      byte  8bit   一个字节,两个字符

  short   16bit  [- 2^15, 2^15 - 1]

  int    32bit  [- 2^31, 2^31 - 1]

  long     64bit  [- 2^63, 2^63 - 1]

  char     16bit  [0, 2^16 -1]

双精度:

  float  32bit

  double  64bit

 

  boolean

2、可以将byte、short、int、long、char赋给float类型,java自动完成转换。

  

posted @ 2016-03-04 16:19  自朗活  阅读(130)  评论(0编辑  收藏  举报