java 数据类型

Literals

8bit   1byte    byte

16bit    2byte short

32bit 4byte int

64bit 8byte long

 http://docs.oracle.com/javase/specs/jls/se8/html/jls-4.html#jls-4.2.1

https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html

The values of the integral types are integers in the following ranges:

  • For byte, from -128 to 127, inclusive

  • For short, from -32768 to 32767, inclusive

  • For int, from -2147483648 to 2147483647, inclusive

  • For long, from -9223372036854775808 to 9223372036854775807, inclusive

  • For char, from 'u0000' to 'uffff' inclusive, that is, from 0 to 65535

0x0000 - 0xffff          0-65535

0x0000 - 0xFFFF       0-65535

原文地址:https://www.cnblogs.com/zno2/p/4629973.html