Check out example codes for "java copy array". It will help you in understanding the concepts better.

Code Example 1

int[] a = {1,2,3,4,5};
int[] b = Arrays.copyOf(a, a.length);

Code Example 2

// Shallow copy
int[] src = {1,2,3,4,5};
int[] dst = Arrays.copyOf(src, src.length);

// Deep copy
int[] dst2 = new int[src.length];
for(int i = 0; i < src.length; i++){
	dst2[i] = src[i];
}

Code Example 3

int[] a = {1, 2, 3};      
int[] b = a.clone();

Learn ReactJs, React Native from akashmittal.com