February 2013
Intermediate to advanced
672 pages
16h 2m
English
The numerical comparison operators <, >, <=, and >=, and the instanceof operator, are called the relational operators.
RelationalExpression: ShiftExpression RelationalExpression < ShiftExpression RelationalExpression > ShiftExpression RelationalExpression <= ShiftExpression RelationalExpression >= ShiftExpression RelationalExpression instanceof ReferenceType
The relational operators are syntactically left-associative (they group left-to-right).
However, this fact is not useful. For example, a<b<c parses as (a<b)<c, which is always a compile-time error, because the type of a<b is always boolean and < is not an operator on boolean values.
The type of a relational expression is always boolean.
Read now
Unlock full access