int x = 0;
int y = 0;
/**modify grade*/
Scanner student = new Scanner(System.in);
System.out.print("Enter student ID:");
int studentId = student.nextInt();
switch (studentId){
case 1101:
Scanner course = new Scanner(System.in);
System.out.print("Enter course ID:");
int courseID = course.nextInt();
switch(courseID){
case 901:
x = 1;
y = 1;
Scanner change = new Scanner(System.in);
System.out.print("Enter new value:");
int newGrade = change.nextInt();
aryTable[x][y] = newGrade;//problem here
break;
break;
}
用“新品级”;它有一个红色下划线表示类型不匹配,但一切似乎都很好,即使是以前使用的 2 台扫描仪也能正常工作。这只是一个复制粘贴,我很困惑为什么这是错误的?我可以得到任何帮助以使其有效吗?我正在制作一个程序,该程序将获取学生,然后获取课程,然后修改相应的成绩..我使用了二维数组..谢谢和欢呼