java中拼接两个数组

1 int a[]={1,2,3,2};

2 int b[]={4,2,90,8,98};

3 int[] d3 = new int[a.length + b.length];

4 System.arraycopy(a, 0, d3, 0, a.length);

5 System.arraycopy(b, 0, d3, a.length, b.length);

System.arraycopy的参数意义:(src, srcPos, dest, destPos, length)--(源数组,源数组开始位置,目标数组,目标数组开始位置,复制长度)

你可能感兴趣的:(java)