May 14, 2021 Groovy
So far, we've seen statements executed one by one in order. /b10> In addition, statements are provided in Groovy to change the flow of control in the program logic. T hey are then classified as the process of the control statements that we will see in detail.
Serial number | Statements and descriptions |
---|---|
1 |
While statement
The while statement is first executed by evaluating the conditional expression (boolean value) and, if the result is true, the statement in the while loop is executed. |
2 |
The for statement
The for statement is used to traverse a set of values. |
3 |
For-in statement
The for-in statement is used to traverse a set of values. |
Serial number | Statements and descriptions |
---|---|
1 |
Break statement
Break statements are used to change the flow of control within loops and switch statements. |
2 |
The continue statement
The continue statement complements the break statement. Its use is limited to while and for loops. |