ForEachIteratesOverIndices
DRAFT

Misconception:

The variable in an enhanced for statement (also know as a for-each loop) will contain indices: 0, 1, and so on.

Incorrect

An enhanced for loop iterates over the indices of an array or a collection

Correct

An enhanced for loop iterates over the elements of an array or a collection

Language

Java

Concepts

Stay up-to-date

Follow us on  twitter to hear about new misconceptions.