If you iterate over an array, the foreach construct means you don't need the index of the array.
So for example:
int[] myArrayValues = new int[4];
In this case, specificValue is equal to myArrayValues ββ[0] on the first iteration through the loop, then myArrayValues ββ[1], myArrayValues ββ[2] and finally myArrayValues ββ[3] when the loop repeats.
Note that in the answer above, although there is a variable i, it is not an index at all and will contain the vales values ββin the array (in this case, they are all 0 until the array is filled with values).
So, for example, to summarize the values ββin an array, we can do something like this:
int[] items = new int[3]; items[0] = 3; items[1] = 6; items[2] = 7; int sum = 0; for( int value : items ) { sum += value; }
Think of it as "for each value in the elements"
source share