0
讀書時,我得到一個java.util.InputMismatchException
,當我從文件中讀取以下信息:java.util.InputMismatchException從文件
的AddRecord CPCS-204 289拉揚Alzahrani 62 58 76
Student s = null;
while (input.hasNext()) {
String command = input.next();
if (command.equals("ADDRECORD")) {
int ID = input.nextInt();
String firstName = input.next();;
String lastName = input.next();
int[] examGrades = new int[nnmCourses];
for (int i = 0; i < nnmCourses; i++) {
examGrades[i] = input.nextInt();
s = new Student(ID, firstName, lastName, examGrades);
System.out.print(nnmCourses);
}
在哪條線上發生該錯誤?這不是編譯器錯誤。 –