导航栏

java数组拷贝

参考链接:https://blog.csdn.net/stitchD/article/details/122575606

  1. 使用for循环

  2. Arrays.copyOf(int[] original, int newLength)
    底层使用了System.arraycopy

  3. copyOfRange(int[] original, int from, int to)
    底层使用System.arraycopy

  4. System.arraycopy(a,0,b,0,b.length);

由c实现,运行速度快

  1. clone()
    objectB=objectA.clone();

  2. BeanUtils.copyProperties

posted @ 2022-06-08 11:04  RickZ  阅读(24)  评论(0)    收藏  举报