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