title: Returning a character element from a two dimensional array
body: <p>I have a method that returns a character element from a two dimensional array of strings based on the input coordinate parameters.</p>
  
  <pre><code>public BattleShips(GameConfiguration config, Player player1, Player player2) {
      this.player1 = player1;
      this.player2 = player2;
      this.config = config;
      this.myBoardPlayer1= new char[20][20];
      this.myBoardPlayer2= new char[20][20];
  }
  protected char getCellState(int player, int x, int y) {
      if (isValidCoordinate(x,y) == true){
          if (player == 0){
              return this.myBoardPlayer1[x][y];
          }
          else if (player == 1){
              return this.myBoardPlayer2[x][y];
          }
      }
      else {
          return (char) -1;
      }
  }
  </code></pre>
  
  <p>The problem is that the above code results in eclipse telling me the method getCellState() isn't returning a result of type char even when i have initialized the instance variables, myBoardPlayer1 and myBoardPlayer2 as char[20][20] in the constructor. </p>
  
  <p>So my question: is this correct the return method for a character element in an array?
  Alternatively, is this.myBoardPlayer1[x][y] not considered a character? If not how can I change my code so that getCellState() returns whatever character value this.myBoardPlayer1[x][y] has?</p>