- Groovy - Meta Object Programming
- Groovy - Template Engines
- Groovy - Unit Testing
- Groovy - Command Line
- Groovy - Builders
- Groovy - Database
- Groovy - DSLS
- Groovy - JSON
- Groovy - JMX
- Groovy - XML
- Groovy - Annotations
- Groovy - Closures
- Groovy - Traits
- Groovy - Generics
- Groovy - Object Oriented
- Groovy - Exception Handling
- Groovy - Regular Expressions
- Groovy - Dates & Times
- Groovy - Maps
- Groovy - Lists
- Groovy - Ranges
- Groovy - Strings
- Groovy - Numbers
- Groovy - Optionals
- Groovy - File I/O
- Groovy - Methods
- Groovy - Decision Making
- Groovy - Loops
- Groovy - Operators
- Groovy - Variables
- Groovy - Data Types
- Groovy - Basic Syntax
- Groovy - Environment
- Groovy - Overview
- Groovy - Home
Groovy Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Groovy - Loops
So far, we have seen statements which have been executed one after the other in a sequential manner. Additionally, statements are provided in Groovy to alter the flow of control in a program’s logic. They are then classified into flow of control statements which we will see in detail.
S.No. | Statements & Description |
---|---|
1 | 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 | The for statement is used to iterate through a set of values. |
3 | The for-in statement is used to iterate through a set of values. |
Loop Control Statements
S.No. | Statements & Description |
---|---|
1 | The break statement is used to alter the flow of control inside loops and switch statements. |
2 | The continue statement complements the break statement. Its use is restricted to while and for loops. |