The following production 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.
==
and !=
boolean
, then the operation is boolean equality. The boolean
equality operators are associative.
The result of ==
is true
if the operands are both true
or both false
; otherwise, the result is false
.
The result of !=
is false
if the operands are both true
or both false
; otherwise, the result is true
. Thus !=
behaves the same as ^
when applied to boolean operands.