+ Start a Discussion
Apex developer 21Apex developer 21 

Explanation condition, what does the : mean in this condition

  for (OfferteLine oli :offerte.OfferteLines.OfferteLine)
Best Answer chosen by Apex developer 21
SandhyaSandhya (Salesforce Developers) 

: in for loop represents the for each item in list or set.

For example, the following code outputs the numbers 1 - 10 to the debug log:
Integer[] myInts = new Integer[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

for (Integer i : myInts) {
here i is the variable, Integer is the data type of list and myInts is the list or set

Please refer below link to know more about loops in apex.


Hope this helps you!

If this helps you, please mark it as solved.

Thanks and Regards