java System.arraycopy 数组复制和合并
public class Test { public static void main(String[] args) { Integer[] a = {1,2,3}; Integer[] b = {4,5,6}; Integer[] c = new Integer[a.length+b.length]; System.arraycopy(a, 0, c, 0, a.length); System.arraycopy(b, 0, c, b.length, b.length); for(Integer i : c){ System.out.println(i); } } }
感谢您的阅读,您的支持是我写博客动力。