java使用Sytem.arraycopy方法复制数组的代码
生活随笔
收集整理的這篇文章主要介紹了
java使用Sytem.arraycopy方法复制数组的代码
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
在開發(fā)之余,將開發(fā)過程中比較好的內(nèi)容備份一次,下邊內(nèi)容是關(guān)于java使用Sytem.arraycopy方法復(fù)制數(shù)組的內(nèi)容,應(yīng)該對大家有用處。 public class Main {
public void copyArrayExample() {int[] intArray = new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};int[] arrayCopy = new int[intArray.length];System.arraycopy(intArray, 0, arrayCopy, 0, intArray.length);for (int i = 0; i < arrayCopy.length; i++)System.out.println(arrayCopy[i]);}public static void main(String[] args) {new Main().copyArrayExample(); } 復(fù)制代碼}
轉(zhuǎn)載于:https://juejin.im/post/5c9ae0376fb9a070ed5400ae
總結(jié)
以上是生活随笔為你收集整理的java使用Sytem.arraycopy方法复制数组的代码的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ^m 问题处理
- 下一篇: SpringMVC源码之参数解析绑定原理