This is very simple, you need an auxilary array of size equal to the sum of two array, here is the code for the same.
public class MergerArray {
public static void main(String[] args) {
int[]a = {1,2,3,4};
int[]b = {4,16,1,2,3,22};
int[]c = new int[a.length+b.length]; //create an array of length=sum of length of two array
int count = 0;
for(int i = 0; i < a.length; i++) {
c[i] = a[i];
count++;
}
for(int j = 0; j < b.length;j++) {
c[count++] = b[j];
}
for(int i = 0;i < c.length;i++) System.out.print(c[i]+" ");
}
}