为什么这不起作用?
public class AddArray
{
public static void main(String[] args)
{
int[] x = {1,2,3};
int[] y = {1,2,3};
dd(x,y);
public static void add(int[]a, int[]b)
{
int[] sum = new int[a.length];
for (int i=0; i<a.length; i++)
sum[i] = a[i] + b[i];
for (int i=0; i<a.length; i++)
System.out.println(sum[i]);
}
}
}