I have to add a matrix of a sudoku to a text-file, I have this code that allows me to save strings, I need to adapt it to save a two-dimensional array (matrix).
How can I adapt my code so it can save a matrix?
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SudokuProject {
public static void main(String[] args) {
try {
BufferedWriter textfile
= new BufferedWriter(new FileWriter("path\\test.txt"));
textfile.write("Hello");
textfile.close();
} catch (IOException ex) {
Logger.getLogger(SudokuProject.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
