Java Language Specification, Version Java SE 21 Edition
14.14.2. The enhanced for statement3 Documented Misconceptions
ForEachIteratesOverIndices
An enhanced for loop iterates over the indices of an array or a collection
ForEachTraversesRecursiveStructure
For-each loops know how to traverse any recursive data structure
ForEachVariableIsElement
One can assign to the variable of an enhanced for statement to store a value in the corresponding array or collection element