title: I'm trying to initialize a 2d array of char into spaces, but the output in the console is weird
body: <p>The following is my constructor, I try to initialize the array with <code>spaces</code>, but when I print out * as the border(in my toString), the weird thing is the output in the console</p>
  
  <pre><code>// constructs a screen based on the dimensions
  public Screen(int height, int width) {
      screen = new char[height+2][width+2];
      for (int i = 0; i &lt; screen.length; i++) {
          for (int j = 0; j &lt; screen[i].length; j++) {
              screen[i][j] = ' ';
          }
      }
  }
  </code></pre>
  
  <p>output is below</p>
  
  <hr>
  
  <p>*<br>
  Ū<br>
  ʪ<br>
  Ϫ<br>
  Ԫ<br>
  ٪<br>
  ު<br>
  ࣪<br>
  ਪ<br>
  ୪୪୪୪୪୪୪୪୪୪୪</p>
  
  <p>I constructor a 9 by 9 screen, I don't know where it went wrong.</p>
  
  <pre><code>public String toString() {
      String str = "";
      for (int row = 0; row &lt; screen.length; row++) {
          for (int col = 0; col &lt; screen[row].length; col++) {
              if (row == 0 || col == 0 || row == screen.length-1) {
                  str += border;
              } else {
                  border += screen[row][col];
              }
          }
          str += "\n";
      }
      return str;
  }
  </code></pre>