-
System.arrayCopy的源代码声明 :
public static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length)
其中,
(1)src
为原数组
(2)srcPos
为原数组的起始位置
(3)dest
为目标数组
(4)destPos
为目标数组的开始起始位置
(5)length
为需要copy的数组长度 -
例:
System.arraycopy(nums, 0, original, 0, nums.length);
==>把num数组中从0开始的数copy到original数组中,从下标0开始,复制的数组长度为nums.length
。
【java】System.arraycopy()用法
最新推荐文章于 2023-09-16 10:23:45 发布