当我尝试显示标记时,BlueJ不断返回java.lang.ArrayIndexOutOfBoundsException。
for (index = 0; index < assignmentLimit; index++)
{
System.out.println("\nAssigment " + (index + 1) + " marks:");
for (indexTwo = 0; indexTwo < studentLimit; indexTwo++)
{
System.out.print("\nMark " + (indexTwo + 1) + ": ");
String input = console.readLine();
mark[grade][indexTwo] = Integer.parseInt(input);
}
}
System.out.print("\n\t" + mark[grade][indexTwo]);
答案 0 :(得分:0)
由于您首先迭代index
,然后再indexTwo
,我猜您真的想要这样做:
mark[index][indexTwo] = Integer.parseInt(input);