Java Reference
In-Depth Information
In practice, the programmer can ignore the null type and just pretend that null is
merely a special literal that can be of any reference type.
4.2. Primitive Types and Values
A primitive type is predefined by the Java programming language and named by its re-
served keyword (§ 3.9 ) :
PrimitiveType:
NumericType
boolean
NumericType:
IntegralType
FloatingPointType
IntegralType: one of
byte short int long char
FloatingPointType: one of
float double
Primitive values do not share state with other primitive values.
The numeric types are the integral types and the floating-point types.
The integral types are byte , short , int , and long , whose values are 8-bit, 16-bit, 32-bit and
64-bit signed two's-complement integers, respectively, and char , whose values are 16-bit
unsigned integers representing UTF-16 code units (§ 3.1 ) .
The floating-point types are float , whose values include the 32-bit IEEE 754 floating-point
numbers, and double , whose values include the 64-bit IEEE 754 floating-point numbers.
The boolean type has exactly two values: true and false .
4.2.1. Integral Types and Values
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
Search WWH ::




Custom Search