Loop
A loop is a compound statement that repeats the statements in its body zero or more times.
Related concepts: StatementRepetitionControl Flow
Closest Wikipedia entry: Control flow: Loops
Misconceptions about Loop12 documented Misconceptions
Check YourselfForEachIteratesOverIndices — Java
An enhanced for loop iterates over the indices of an array or a collection
ForEachTraversesRecursiveStructure — Java
For-each loops know how to traverse any recursive data structure
ForEachVariableIsElement — Java
One can assign to the variable of an enhanced for statement to store a value in the corresponding array or collection element
ForIsConditional — Java
The body of a for statement executes at most once
ForVariableScopeBeyondLoop — Java
The scope of variables declared in a for loop header extends beyond the loop
IfIsLoop — Java
The body of an if statement executes repeatedly, as long as the condition holds
LoopBodyScopeImpliesLoopLifetime — Java
Lifetime of variables declared in a loop body extends across all loop iterations
LoopTerminatingCondition — Java
For and while loops end when the condition becomes true
PreIncrementBeforeLoop — Java
Pre-increment in update part of for loop means increment before loop body
IfIsLoop — Python
The body of an if-statement executes repeatedly, as long as the condition holds
RepeatDistributes — Scratch
Each block in a loop is repeated individually
ResetStateEachLoopIteration — Scratch
The computation of all loop iterations starts from the state before the loop