首页 > 编程语言 > 详细

java arrayCopy

时间:2014-07-17 14:28:36      阅读:320      评论:0      收藏:0      [点我收藏+]

int[] dest = new int[0];
int[] value = {1,2};
if(value != null && value.length>0)
{
int[] tmp = dest;
dest = new int[value.length+tmp.length];
System.arraycopy(tmp, 0, dest, 0, tmp.length);
System.arraycopy(value, 0, dest, tmp.length, value.length);
}
int[] value2 = {3,4};
if(value2 != null && value2.length>0)
{
int[] tmp = dest;
dest = new int[value2.length+tmp.length];
System.arraycopy(tmp, 0, dest, 0, tmp.length);
System.arraycopy(value2, 0, dest, tmp.length, value2.length);
}

java arrayCopy,布布扣,bubuko.com

java arrayCopy

原文:http://www.cnblogs.com/kevinge/p/3850808.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!