<<< Numeric Ranges in Java | Index | Numeric Ranges in Java, cont. >>> |
The previos if statement is illegal in Java!
The expression
1 < value < 10
is interpreted as
( 1 < 7 ) < 10
which then becomes
true < 10
which is illegal expression because Java does not allow comparing boolean values with other data types.
<<< Numeric Ranges in Java | Index | Numeric Ranges in Java, cont. >>> |