s-day01-System中的arrayCopy方法
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.inmind.system06;
|
||||
/*
|
||||
System中的arrayCopy方法
|
||||
|
||||
static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length)
|
||||
将指定源数组中的数组从指定位置复制到目标数组的指定位置。
|
||||
参数一src :表示源数组
|
||||
参数二srcPos:表示源数组的索引位置
|
||||
参数三dest:表示目标数组
|
||||
参数四destPos:表示目标数组的索引位置
|
||||
参数五length:长度
|
||||
|
||||
将src数组中前3个元素,复制到dest数组的前3个位置上
|
||||
复制元素前:
|
||||
src数组元素[1,2,3,4,5],
|
||||
dest数组元素[6,7,8,9,10]
|
||||
复制元素后:
|
||||
src数组元素[1,2,3,4,5],
|
||||
dest数组元素[1,2,3,9,10]
|
||||
*/
|
||||
public class SystemDemo16 {
|
||||
/*
|
||||
复制元素前:
|
||||
src数组元素[1,2,3,4,5],
|
||||
dest数组元素[6,7,8,9,10]
|
||||
复制元素后:
|
||||
src数组元素[1,2,3,4,5],
|
||||
dest数组元素[6,7,2,3,4]
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
//static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length)
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user