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

Code Example 1

int[] src  = new int[]{1,2,3,4,5};
int[] dest = new int[5];

System.arraycopy( src, 0, dest, 0, src.length );

Code Example 2

int a[] = {1, 8, 3}; 
  
// Copy elements of a[] to b[] 
int b[] = a.clone();

Code Example 3

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

Learn ReactJs, React Native from akashmittal.com