boolean

15.7.1 Literals

A literal denotes a fixed, unchanging value.

The following production is repeated here for convenience:

Literal:

IntegerLiteral
FloatingPointLiteral
BooleanLiteral
CharacterLiteral
StringLiteral
NullLiteral

The type of a literal is determined as follows:

Evaluation of a literal always completes normally.

15.20.2 Boolean Equality Operators == and !=

If the operands of an equality operator are both of type 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.