java copy array and add one code example Example: java copy array int[] a = {1, 2, 3}; int[] b = a.clone();