Note: If either the
if
action or theelse
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>