apache-commons
ArrayUtils.addAll(Object[], Object[])
java
// Arrays.copyOf()
public static <T> T[] concat(T[] first, T[] second) {
T[] result = Arrays.copyOf(first, first.length + second.length);
System.arraycopy(second, 0, result, first.length, second.length);
return result;
}
// System.arraycopy()
static String[] concat(String[] a, String[] b) {
String[] c= new String[a.length+b.length];
System.arraycopy(a, 0, c, 0, a.length);
System.arraycopy(b, 0, c, a.length, b.length);
return c;
}
作者
jnan77
发表于
2019-09-09 16:01:40
,添加在分类
编程语言
下
,最后修改于
2019-09-09 16:02:10
Comments