How the updation goes in enhanced for loop?

how enhanced for loop gets update itself?

The usual way to step through all the elements of an array in order is with a “standard” for loop, for example,

for (int i = 0; i < myArray.length; i++) {
System.out.println(myArray[i]);
}

The enhanced for loop is a simpler way to do this same thing. (The colon in the syntax can be read as “in.”)

for (int myValue : myArray) {
System.out.println(myValue);
}

Enhanced for loops are simple but inflexible. They can be used when you wish to step through the elements of the array in first-to-last order, and you do not need to know the index of the current element. It updates itself and traverses the whole array.