public int[] join(int[] arr1,int[] arr2){
int[] joinArr=new int[arr1.length + arr2.length];
int j=0,k=0;
for(int i=0;i
You have 4 possible outcomes. In the last two outcomes, you increment the index when you take a value from arr1[j]
or arr2[k]
You have to do the same for all outcomes, otherwise you just the value you were up to repeatedly.
BTW I suggest you