Page 1348 - AP Computer Science A, 7th edition
P. 1348
33. (D) The remove method removes from arr the element arr[index]. It does this by copying all elements from arr[0] up to but not including arr[index] into array b. Thus, b[k] == arr[k] for 0 <= k < index is true. Then it copies all elements from arr[index + 1] up to and including arr[arr.length – 1] into b. Since no gaps are left in b, b[k] == arr[k + 1] for index <= k < arr.length – 1. The best way to see this is with a small example. If arr is 2, 6, 4, 8, 1, 7, and the element at index 2 (namely the 4) is to be removed, here is the picture:
Notice that arr.length is 6, but k ends at 4.