Remember that arrays in Java don't grow so you need to take care of the buffering yourself.
If you move say 5 places to the right, create a buffer of 5 elements.
Move the last 5 elements out of the array into the buffer, then move every element in the array (except those 5) 5 places to the right.
Finally most those 5 elements into the first 5 positions in the original array.
Reputation Points: 1658
Solved Threads: 331
duckman
Offline 7,719 posts
since Nov 2004