数组小知识点

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

\t:空格

\n:换行

public static int[] copyOf(int[] original, int newLength) {
int[] copy(目标数组) = new int[newLength(数组长度)];
System.arraycopy(original(原数组), 0(从原数组什么位置开始拷贝), copy(拷贝), 0(从目标数组什么位置开始放),

//Math.min(original.length, newLength):长度,取最小值,原数组和新数组那个新的和原数组

Math.min(original.length, newLength));
return copy;
}

 

posted @ 2018-07-21 20:26  Monica_维维  阅读(118)  评论(0编辑  收藏  举报