Section 4.5 if Single-Selection Statement

• Programs use selection statements to choose among alternative courses of action.

• The single-selection if statement’s activity diagram contains the diamond symbol, which indicates that a decision is to be made. The workflow follows a path determined by the symbol’s associated guard conditions (p. 106). If a guard condition is true, the workflow enters the action state to which the corresponding transition arrow points.

• The if statement is a single-entry/single-exit control statement.

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.