Java · Loops
The most common loop bug runs one pass too many or one too few, and two quick checks catch it.