Here you can find the source of merge(E[] arrayA, E[] arrayB)
Parameter | Description |
---|---|
arrayA | the first array |
arrayB | the second array |
public static <E> E[] merge(E[] arrayA, E[] arrayB)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { /**//from www .j a v a 2 s . co m * Merges the two arrays passed in argument into a single one, * in the order specified. * * @param arrayA * the first array * @param arrayB * the second array * @return new array */ public static <E> E[] merge(E[] arrayA, E[] arrayB) { E[] result = Arrays.copyOf(arrayA, arrayA.length + arrayB.length); System.arraycopy(arrayB, 0, result, arrayA.length, arrayB.length); return result; } }