O'Reilly logo

Groovy Programming by John Savage, Kenneth Barclay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required