如果我们想拷贝一个数组,我们可能会使用System.arraycopy()或者Arrays.copyof()两种方式.在这里,我们将使用一个比较简单的示例来阐述两者之间的区别. 1.示例代码: System.arraycopy() ,,,,}; ]; System.arraycopy(arr, , copied, , );//5 is the length to copy System.out.println(Arrays.toString(copied)); 运行结果: [0, 0, 0, 0…