//数组复制
//System.arraycopy(src,srcPos,dest,desPos,length)
/* src: 源数组
srcPos: 从源数组复制数据的起始位置
dest: 目标数组
destPos: 复制到目标数组的起始位置
length: 复制的长度
**/
public class helloWorld{
public static void main(String[] args){
int a[]= new int[]{12,3,5,7,9,4};
int b[] = new int[3];
System.arraycopy(a,1,b,3);
for(int each:b){
System.out.println(each);
}
}
}
网友评论