数组复制
Object[] listSource=Arrays.asList("a","b","c","d").toArray();
Object[] listDest=Arrays.asList("e","f","g","h","k").toArray();
System.arraycopy(listSource,2,listDest,3,2);
System.out.println(Arrays.asList(listSource));
System.out.println(Arrays.asList(listDest));
输出:
[a, b, c, d]
[e, f, g, c, d]
参数分析:
* @param src the source array.
* @param srcPos starting position in the source array.
* @param dest the destination array.
* @param destPos starting position in the destination data.
* @param length the number of array elements to be copied.