byte
, from -128 to 127, inclusive
short
, from -32768 to 32767, inclusive
int
, from -2147483648 to 2147483647, inclusive
long
, from -9223372036854775808 to 9223372036854775807, inclusive
char
, from '\u0000'
to '\uffff'
inclusive, that is, from 0 to 65535
The following production from is repeated here for convenience:
Literal:The type of a literal is determined as follows:
IntegerLiteral
FloatingPointLiteral
BooleanLiteral
CharacterLiteral
StringLiteral
NullLiteral
L
or l
is long
; the type of any other integer literal is int
.
F
or f
is float
; the type of any other floating-point literal is double
.
boolean
.
char
.
String
.
null
is the null type; its value is the null reference.