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
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started