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