how to store an array in another array in java code example Example: java copy array int[] a = {1,2,3,4,5}; int[] b = Arrays.copyOf(a, a.length);