Create Copy Of Array From Another Array Code Example

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();