title: How to add strings to a 2d array of objects?
body: <p>So I have a 2d array of objects of class <code>Cell</code>. This is for a connect 4 game. Right now the size of this array is determined by an argument when the board is initiated. It looks like this:</p>
  
  <pre><code>public ConnectSome(int size){
      board = new Cell[(size*2)-1][(size+2)];
      for(int i = 0 ; i&lt;board.length; i++)
          for(int j = 0; j&lt;board[i].length; i++)
              board[i][j] = new Cell();
  </code></pre>
  
  <p>I need to make a <code>toString()</code> method where it turns the board into a string and returns it. I already have a <code>toString()</code> method for the <code>Cell</code> class which returns the state of that cell (in this case its Yellow,Red or empty).</p>
  
  <p>How do i make this method return a string not just showing each cell in a string form, but also surrounding it by a frame? I've had a go at it but I'm lost. It's supposed to look like this:</p>
  
  <pre><code>|.......|
  |.......|
  |.......|
  |.......|
  |.......|
  |.......|
  +-------+
  </code></pre>
  
  <p>Where the periods (.) are <code>Cell</code> objects that are "empty" (the result of using <code>toString()</code> on the <code>Cell</code>.) This is just an example board, the size can vary but the borders are what I'm trying to achieve.</p>