For Each Loop

For the ‘for each’ loop in the example provided

for(Integer temperature : weeklyTemperatures) {
System.out.println (temperatures)
}
When was the Array data entered under weeklyTemperatures redefined as temperature? is that what the For Each Loop did at the start of the statement?

It is defined in the loop context as a local reference that a reader can understand. All the labels are for humans, not the computer.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.