import java.util.Arrays;
public class Arrays{
public static void main(String[] args) {
int[]arr1={1,2,3,4,5,6,7,8};
System.out.println(arr1.length);
int[]arr1s={10,11,12,13,14,15};
System.out.println(arr1s.length);
int[]ar1=new int[arr1.length+ arr1s.length];
System.arraycopy(arr1,0,ar1,0,arr1.length);
System.arraycopy(arr1s,0,ar1,arr1.length,arr1s.length);
System.out.print(Arrays.toString(ar1));
}
}
原文:https://www.cnblogs.com/hhc16619804375/p/14297914.html