码迷,mamicode.com
首页 > 编程语言 > 详细

数组小知识点

时间:2018-07-21 21:33:12      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:copy   mat   turn   ret   数组   目标   知识   sys   math   

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;
}

数组小知识点

标签:copy   mat   turn   ret   数组   目标   知识   sys   math   

原文地址:https://www.cnblogs.com/Koma-vv/p/9347866.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!