Java Reference
In-Depth Information
A compile-time error does not occur if a non-zero floating-point literal has a small value
that, on rounded conversion to its internal representation, becomes a non-zero denormal-
ized number.
Predefined constants representing Not-a-Number values are defined in the classes
Float
and
Double
as
Float.NaN
and
Double.NaN
.
Examples of
float
literals:
1e1f 2.f .3f 0f 3.14f 6.022137e+23f
Examples of
double
literals:
1e1 2. .3 0.0 3.14 1e-9d 1e137
3.10.3. Boolean Literals
The
boolean
type has two values, represented by the
boolean literals
true
and
false
, formed
from ASCII letters.
BooleanLiteral: one of
true false
3.10.4. Character Literals
ASCII single quotes. (The single-quote, or apostrophe, character is
\u0027
.)
CharacterLiteral:
'
SingleCharacter
'
'
EscapeSequence
'
SingleCharacter:
InputCharacter but not
'
or
\
See §
3.10.6
for the definition of
EscapeSequence
.
ues from
\u0000
to
\uffff
. Supplementary characters must be represented either as a surrogate
pair within a
char
sequence, or as an integer, depending on the API they are used with.