克隆阵列
//package com.nowjava; /*nowjava.com - 时代Java 提供*/ public class Main { public static Integer[] cloneArray(Integer[] arr) { Integer[] newArr = new Integer[arr.length]; System.arraycopy(arr, 0, newArr, 0, arr.length); return newArr; } }
//package com.nowjava; /*nowjava.com - 时代Java 提供*/ public class Main { public static Integer[] cloneArray(Integer[] arr) { Integer[] newArr = new Integer[arr.length]; System.arraycopy(arr, 0, newArr, 0, arr.length); return newArr; } }