首页 > 学院 > 开发设计 > 正文

java中拼接两个数组

2019-11-14 21:06:53
字体:
来源:转载
供稿:网友
java中拼接两个数组 Posted on 2014-09-10 23:13 糖醋里脊er 阅读(...) 评论(...) 编辑 收藏
1 int a[]={1,2,3,2};2 int b[]={4,2,90,8,98};3 int[] d3 = new int[a.length + b.length];4 System.arraycopy(a, 0, d3, 0, a.length);5 System.arraycopy(b, 0, d3, a.length, b.length);

System.arraycopy的参数意义:(src, srcPos, dest, destPos, length)--(源数组,源数组开始位置,目标数组,目标数组开始位置,复制长度)


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表