Conditional Statements

Alternative Syntax

Note: If either the if action or the else action is just a single statement, you may leave out the curly braces, although some people and companies prefer to always use them.

Alternative Syntax for Single-Statement Actions:
if ( <boolean-expression> )
    <the single statement for the first alternative>
else            // No boolean expression goes here!
    <the single statement for the second alternative>

Alyce Brady, Kalamazoo College