android典型代码系列(十九)------将一个数组复制成为另外一个数组的方法

来源:互联网 发布:head first sql pdf 编辑:程序博客网 时间:2024/06/05 03:21

将一个数组复制成为另外一个数组的方法 :

 private final <T> T[] copy(T[] source) {        Class type = source.getClass().getComponentType();        T[] target = (T[])Array.newInstance(type, source.length+1);        System.arraycopy(source, 0, target, 0, source.length);        return target;     }
0 0
原创粉丝点击