标签:arraycopy
public static native void arraycopy(Object src, int srcPos,Object dest, int destPos,
int length);
实验代码:
public class ArrayTest08{
public static void main(String[] args){
int[] src = {2,3,4,5,6,7,8};
int[] dest = {10,11,12,13,14,15,16};
//把src中的4,5,6拷贝到dest数组从13开始.
System.arraycopy(src, 2, dest, 3, 3);
//遍历
for(int i=0;i<dest.length;i++){
System.out.println(dest[i]);
}//10.11.12.4.5.6 16
}本文出自 “gaogaozi” 博客,请务必保留此出处http://hangtiangazi.blog.51cto.com/8584103/1661771
标签:arraycopy
原文地址:http://hangtiangazi.blog.51cto.com/8584103/1661771