Notes
In Apex, which is a programming language used by Salesforce for building custom applications, a "for" loop is used to iterate over a collection of items, such as a list or a set. Apex supports three types of "for" loops: the traditional "for" loop, the "for-each" loop, and the "for" loop with a list or set.
for (initialization; condition; increment/decrement) {
// Code to be executed in each iteration
}
Here are some examples:
for (Integer i = 0; i < 5; i++) {
System.debug('Iteration ' + i);
}
Output:
Iteration 0
Iteration 1
Iteration 2
Iteration 3
Iteration 4
Video
Video does not exists.