我正在尝试运行此代码,并且我一直收到ArrayIndexOutOfBound
异常错误。Java ArrayIndexOutOfBound异常
public class Heisenberg {
public static void main(String[] args) {
int[] array1 = new int[5];
int[] array2 = new int[5];
Ext(-1, 10, array1, array2);
}
public static void Ext(int q, int w, int[] e, int[] r) {
if (q >= 0)
e[q] = w;
r[q] = w;
}
}
我对数组有点不熟悉,所以对所有帮助表示赞赏。 enter code here