我正在尝试运行此代码,但我不断收到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