I think you have to allocate a new array and put the values into the new array. For example:
int[] array1and2 = new int[array1.length + array2.length];
int currentPosition = 0;
for( int i = 0; i < array1.length; i++) {
array1and2[currentPosition] = array1[i];
currentPosition++;
}
for( int j = 0; j < array2.length; j++) {
array1and2[currentPosition] = array2[j];
currentPosition++;
}
As far as I can tell just looking at it, this code should work.