对数组遍历
System.out.println(Arrays.toString(templist));
对数组的值传递
System.arraycopy(list, 0, templist, 0, list.length);//(数组名,数组位置,数组名,数组位置,传递个数)
运行结果
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] arr = {1, 5, 3, 6, 7};
int[] arr1=new int[arr.length];
System.out.println(Arrays.toString(arr));
System.arraycopy(arr, 0, arr1, 0, arr.length);
System.out.println(Arrays.toString(arr1));
}