There are several different ways to copy arrays of object (primitive types) in Java.
However,
the fastest way seems to be System.arraycopy
.
This methed is implemented using native code and only performs a shallow copy.
Acutally most methods for copying arrays in Java perform shallow copy.
int arr1[] = {0 …