A sample of the statement to type when using the method is
System.arraycopy(data, i, data, i+1, data.length-i-1);
The way it works according to my book is that the system move all element from i
onward one position up. But intuitively I will think that the method will move all the element after i
one position down. So there is empty space to put the copied element.
I am confused now as to how to move elements around in the same array. What does the statement really say?