System.arraycopy() is a shallow copy method.
For an array of a primitive type, it will copy the values from one array to another:
int[] a = new int[]{1,2};
int[] b = new int[2];
System.arraycopy(a, 0, b, 0, 2);
b will be {1,2} now. Changes in a will not affect b.
For an array of a non-primitive type, it will copy the references of the object from one array to the other:
MyObject[] a = new MyObject[] { new MyObject(1), new MyObject(2)};
MyObject[] b = new MyObject[2];
System.arraycopy(a, 0, b, 0, 2);
b will contain a reference of new MyObject(1), new MyObject(2) now. But, if there are any changes to new MyObject(1) in a, it will affect b as well.
Are the above statements correct or not?