详细解释如下,希望对你有所帮助
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- // System.arraycopy("原数组", "原数组的开始下标", "目标数组", "目标数组的开始下标", "拷贝长度");
- 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.print(dest[i]+" ");
- }
- System.out.println();
复制代码
} |