Here you can find the source of concat(T[] a, T[] b)
public static <T> T[] concat(T[] a, T[] b)
//package com.java2s; import java.lang.reflect.Array; public class Main { public static <T> T[] concat(T[] a, T[] b) { final int alen = a.length; final int blen = b.length; if (alen == 0) { return b; }//w ww . j a v a2s .com if (blen == 0) { return a; } final T[] result = (T[]) Array.newInstance(a.getClass() .getComponentType(), alen + blen); System.arraycopy(a, 0, result, 0, alen); System.arraycopy(b, 0, result, alen, blen); return result; } }