没有直接这样的方法,得自己编写,不过推荐一个方法
System.arraycopy(b, 0, a, a.length, a.length);
但是在这之前你得把b处理一下,数组长度不可变,所以重新创建一个数组吧
public class new_1 {
static int[][] arraysAdd(int[][] a,int[][] b)
{
int [][] return_l = new int[a.length+b.length][a[0].length];
System.out.println("The length for return_l is "+return_l.length);
if (a != null)
System.out.println("The length for return_l[0] is "+return_l[0].length);
for (int i =0; i < a.length+ b.length;i++)
for(int j =0; j < a[0].length ; j++)
{
if (i
System.out.println(" the value for ["+i+"]["+j+"] is "+return_l[i][j]);
}
return return_l;
}
public static void main(String args[]) {
int[][] aTst1 = {{1,2},{2,3},{1,3}}, aTst2 = {{4,5}, {6,4}};
int[][] aTst3 =arraysAdd(aTst1,aTst2);
}
}
没有api的函数,自己编写吧。