Transferring a 2D array into a file and back
<p>I've looked around at similar questions, but I'm still stuck on this bit of code. </p>

<pre><code>public class MasterMindSaveLoad extends Board {
    public void saveGame() {
        ObjectOutputStream oos = new ObjectOutputStream(new FileWriter("saveGame.txt"));
            for (int i=0; i&lt;numPegs; i++) {
                for (int j=0; j&lt;numColours; j++) {
                    oos.writeObject(Board[i][j]);
                }
            }
            for (int i=0; i&lt;numPegs; i++) {
                for (int j=0; j&lt;numColours; j++) {
                    oos.writeObject(Feedback[i][j]);
                }
            }

        }
    public void loadGame(String savedGame) {
        try {

        } catch (MasterMindFileFormatException e) {

        } catch (IOException e) {

        }
    }
}
</code></pre>

<p>I have been given a really rough layout for saving a 2D array into a file and reading back from it. I was not sure how to go about it, and this is as much as I've got so far. I have to actually save two 2D arrays, and then when reading, I have to put them back into their own arrays again.</p>