Java合并两个数组为一个新数组

String[] a = new String[];
String[] b = new String[];
String[] c = new String[a.length+b.length]; 
//System.arraycopy(src,srcStartPosition,des,desStartPosition,要复制的长度)
System.arraycopy(a, 0, c, 0, a.length); 
System.arraycopy(b, 0, c, a.length, b.length);

return c;

 


posted @ 2021-03-17 09:48  CEO雷总  阅读(1540)  评论(0编辑  收藏  举报