Snippet 1
int[] a = {1,2,3,4,5};
int[] b = Arrays.copyOf(a, a.length);
Snippet 2
int[] a = {1, 2, 3};
int[] b = a.clone();
Copyright © Code Fetcher 2020
Snippet 1
int[] a = {1,2,3,4,5};
int[] b = Arrays.copyOf(a, a.length);
Snippet 2
int[] a = {1, 2, 3};
int[] b = a.clone();
Copyright © Code Fetcher 2020