<<< Examples of conditional expressions | Index | An if without else >>> |
The syntax of the if-else statement is
if ( booleanExpression ) { statements } [else if ( booleanExpression ) { statements }]<sub>optional</sub> ... [else {statements}]<sub>optional</sub>
The if statements compare primitive data types in a boolean expression
Boolean expressions are enclosed in parentheses and use relational operators
<<< Examples of conditional expressions | Index | An if without else >>> |