System.arraycopy使用方法:

System.copy使用方法:
 java

int[] ids = { 1, 2, 3, 4, 5 };  
    System.out.println(Arrays.toString(ids)); // [1, 2, 3, 4, 5]  
    // 测试自我复制  
    // 把从索引0开始的2个数字复制到索引为3的位置上  
    System.arraycopy(ids, 0, ids, 3, 2);  
    System.out.println(Arrays.toString(ids)); // [1, 2, 3, 1, 2]
相关文章
相关标签/搜索