Java · Arrays

Shifting, reversing and copying

Moving elements inside one array can overwrite a value before it is used, so the order of the copies decides the result.