java System.arraycopy 数组复制和合并

public class Test {
    public static void main(String[] args)  {
         Integer[] a = {1,2,3};
         Integer[] b = {4,5,6};
         Integer[] c = new Integer[a.length+b.length];
         System.arraycopy(a, 0, c, 0, a.length);
         System.arraycopy(b, 0, c, b.length, b.length);
         for(Integer i : c){
             System.out.println(i);
         }
    }
}
原文地址:https://www.cnblogs.com/chenweichu/p/6108253.html