两个Stirng[]拼接成一个数组

 

import org.apache.commons.lang.ArrayUtils;

String[] str1 = {"Hello","world","java"};
String[] str2 = {"Veriable","syntax","interator"};
String [] str3= {};
String[] both = (String[]) ArrayUtils.addAll(str1, str3);

for(int i=0;i<both.length;i++) {
System.out.print(both[i]+",");
}

 

结果:

Hello,world,java,

posted @ 2018-08-05 08:54  青蛙跳跳  阅读(122)  评论(0编辑  收藏  举报