package com.oracel.demo01; public class Sz { public static void main(String[] args) { // TODO Auto-generated method stub menthod(); } public static void menthod(){ //原数组 int[] arr={3,6,8,9,4,5}; //目标数组 int[] arr2=new int[3]; //原来要是有数的话会覆盖 //原数组,第几位,目标数组,第几位,一共复制多少位 System.arraycopy(arr, 3, arr2, 0, 3); for(int i:arr2){ System.out.println(i); System.gc(); } } }