总结:arraycopy注意数组定义的长度。不足会补0
package clientFrame; //数组的复制arraycopy() public class Xiang { public static void main(String[] args) { int a[] = new int[] { 2, 3, 4, 6, 7 }; int b[] = new int[3];// 位数 System.arraycopy(a, 0, b, 0, 3); for (int i = 0; i < b.length; i++) { System.out.print(b[i] + " "); } } } 2 3 4