Apex Developer Guide
Release Notes
Conditional (If-Else) Statements
Switch Statements
Do-While Loops
While Loops
Apex Reference
Previous PDF Versions
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
Apex supports five types of procedural loops.
These types of procedural loops are supported:
do {statement} while (Boolean_condition);while (Boolean_condition) statement;for (initialization; Boolean_exit_condition; increment) statement;for (variable : array_or_set) statement;for (variable: [inline_soql_query]) statement;All loops allow for loop control structures:
break; exits the entire loop
continue; skips to the next iteration of the loop