for Statement UML Activity Diagram
for repetition statement’s UML activity diagram is similar to that of the
while statement (Fig. 4.5). Figure 5.4 shows the activity diagram of the
for statement in Fig. 5.2. The diagram makes it clear that initialization occurs once before the loop-continuation test is evaluated the first time, and that incrementing occurs each time through the loop after the body statement executes. Note that (besides an initial state, transition arrows, a merge, a final state and several notes) the diagram contains only action states and a decision.