Remember, however, that arrays typically perform better than Vectors, if that is a consideration later on.
And, as Peter Haggar points out in his book
Practical Java, there is a System class in the java.lang package with a method called
arraycopy(Obj src, int src_pos, Obj dest, int dest_pos, int length);
It takes a sorce array and a destination array, and using starting positions and a length, to quickly copy an array (nearly twice as fast as a for loop).
The code would look like this:
Apparently this is faster because the method is implemented as a native method, which can more directly and efficiently transfer the contents in memory from source to destination.
However, the arraycopy method has a number of gotchas to watch out for if you look in the API when you go beyond simple copying like above.
OP