Plain old quick sort
Using counter for both for loops seems awkward.

for(int i = 0; i &lt; n1; i++) {
    result[i] = a1[i];
}
for(int i = 0; i &lt; n2; i++) {
    result[n1 + i] = a2[i];
}


This way, the for loop looks just like people expect it to look. Your implementation requires extra thought. There is still a single arithmetic operation for indexing in the second loop, so reusing counter is not saving you anything.



One line if statements can be missed by someone reading your code. Plus you need to remember to add curly brackets if you want to add a second line.



concatArrays(int[] a1, int a2) does not concatenate arrays. Function names that lie about what they do are bad.