📜  Groovy-循环

📅  最后修改于: 2020-11-04 06:36:28             🧑  作者: Mango


到目前为止,我们已经看到了依次执行的语句。另外,在Groovy中提供了语句来更改程序逻辑中的控制流。然后将它们分为控制语句流,我们将对其进行详细介绍。

S.No. Statements & Description
1 While Statement

The while statement is executed by first evaluating the condition expression (a Boolean value), and if the result is true, then the statements in the while loop are executed.

2 for Statement

The for statement is used to iterate through a set of values.

3 for-in Statement

The for-in statement is used to iterate through a set of values.

循环控制语句

S.No. Statements & Description
1 Break Statement

The break statement is used to alter the flow of control inside loops and switch statements.

2 Continue Statement

The continue statement complements the break statement. Its use is restricted to while and for loops.