else
- Purpose
- To provide an alternative course of action.
elsecan be used following anifstatement. See the page describing the associated keywords for more details. - Examples
if (length > 0) println 'O.K.' else println 'No good' if (a != b) c=d else println 'Values match'- Description
- Part of the
if...else...structure. - Syntax
-
if (conditionalExpression) statement else statement if (conditionalExpression) {statements} else {statements} - Associated keywords
if