[Java] – How to concatenate two arrays?

public int[] joinArrays(int[] int1, int[] int2) {
    int[] result = new int[Arr.length];
    System.arraycopy( int1, 0, result, 0, int1.length);
    System.arraycopy( int2, 0, result, int1.length, int2.length );
    return result;
}

Leave a comment