off-by-one error
A loop that runs one pass too many or one too few.
A bound or starting value wrong by one, typically < written for <= or a count started at 0 instead of 1; for (int i = a; i < b; i++) runs b - a times.
Examples
for (int i = 0; i <= a.length; i++)reads one past the end and throws.
See also