int [][] matrix = new int [9][9]; Scanner sc = new Scanner(System.in); System.ou
ID: 3723165 • Letter: I
Question
int [][] matrix = new int [9][9];
Scanner sc = new Scanner(System.in);
System.out.print("Enter file name ");
String fileName = sc.next();
Scanner input = new Scanner (fileName);
while (input.hasNext()){
for (int col = 0; col < 9 ; col ++){
for (int row = 0; row < 9 ; col ++){
sudoku [col][row] = input.nextInt();
System.out.println(matrix [col][row]);
}
}
}
}
i got error this
Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:864)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextInt(Scanner.java:2117)
at java.util.Scanner.nextInt(Scanner.java:2076)
at Sudoku.main(matrix.java:30)
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.