package org.springframework; /** * @author 秦林森 */ public class Test { public static void main(String[] args) { int[] sourceArray = {1, 2, 3, 4, 5}; int[] destArray={8,9,10,11,12,16}; //改变目标数组 System.arraycopy(sourceArray,1,destArray,3,3); for(int sourceElement:sourceArray){ System.out.println(sourceElement); } //分割两次打印结果 System.out.println("*************************"); for(int destElement:destArray){ System.out.println(destElement); } } }