Please enable JavaScript to use CodeHS

AP CSA: VAR-2.B.3

CodeHS Lessons

Since the indices for an array start at 0 and end at the number of elements - 1, “off by one” errors are easy to make when traversing an array, resulting in an ArrayIndexOutOfBoundsException being thrown.