+ 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) 
Hi,

: 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) {
    System.debug(i);
}
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.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_loops_for.htm

Hope this helps you!

If this helps you, please mark it as solved.

Thanks and Regards
Sandhya