Java System.arrayCopy

用了几次都没记住用法,发文记一下

public static native void arraycopy(Object src,  int  srcPos,
                                        Object dest, int destPos,
                                        int length);

src – the source array.
srcPos – starting position in the source array.
dest – the destination array.
destPos – starting position in the destination data.
length – the number of array elements to be copied.

Object src 要复制的对象

int srcPos 指定复制数组的起始位置

Object dest 目标对象

int destPos 指定要复制的内容,复制到目标数组的位置

int length 代表要复制的内容到 dest 数组的长度,该数值不能超过 dest.length - desPos

上一篇:System_听韩顺平课笔记


下一篇:2021-11-11