And I need to take the elements from array1 and put them at the end of array2. array1 will need to be empty afterwards, so no copying. Ideas? Or is there somewhere I can go to read about it?
I think that you don't really understand what an array is; if I do this:
I end up with 42 adjacent slots and each slot can contain a T, whatever that T is;
if T is a primitive (int, double etc). the slots of the new array have all their bits set
to zero which effectively results in values 0 or 0.0 or 0L for the primitive type T.
If T is some type of object (a class or interface or enum) all the bits of all the slots
also have their bits set to zero which effectively results in the value 'null' which
means that none of the slots point to a type T, whatever T happens to be.
But whatever you do you always have those 42 slots until you forget about the
entire array altogether, i.e. you can't add slots nor can you remove slots from the
array. It is one chunk of 42 adjacent slots with index values 0, 1, 2 ... 41
Your remark about 'empty arrays' and 'no copying' is confusing at best and doesn't
make any sense at worst. The only thing you can do with those slots in an array
is change their value or copy their value to somewhere else.
kind regards,
Jos