CHAPTER 8 FLOW OF CONTROL

The execution of a program statement causes an action to be performed. The programs we have developed execute one statement after another in a sequential manner. Because of this execution ordering of the statements, we describe the program logic as sequential. We can also create abstract actions with method definitions and then treat them as if they, likewise, were simple statements through their method calls. The statements we have explored include the assignment, input/output, and method calls.

Additionally, statements are provided in Groovy to alter the flow of control in a program’s logic. They are then classified into one of three program flow of control structures:

  • sequence
  • selection
  • iteration

8.1 WHILE STATEMENT ...

Get Groovy Programming 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.