title: a class method returns the same value all the time
body: <p>My code is given below. the problem is that whatever value (0 or 1) I enter in player[xxx].takenSquare[row][col]=true;  (where the xxx is ) the method does not set it correctly and as a result the <code>drawSquare</code> method always returns " O " even if the player 1 has taken the square..</p>
  
  <pre><code>static boolean  [][]takenSquare= new boolean [3][3];
  int [][]playerTable; //gia tin niki
  static tictac[] player = { 
      new tictac( "PlayerName1" ),
      new tictac( "PlayerName2" ),
  };
  static private int row;  //&lt;---
  static private  int col;  //""
  private  static int activePlayer;
  public tictac(String name){
      this.name=name;
      playerTable=new int[3][3];
  
  }
  public static boolean isValidMove(int row,int col){
      boolean valid=false;
      if( ( row &gt;= 0 &amp;&amp; row&lt;3 ) &amp;&amp; ( col &gt;=0 &amp;&amp;col &lt; 3 ) ) {
  
          if ( takenSquare[ row ][ col ] == false ) {
              valid = true;
          }
      }
      return valid;
  }   //isValidmove
  public static void setMove (int nrow, int ncol,int active){
      col=ncol-1;
      row=nrow-1;
     /* StringTokenizer tokenizer=new StringTokenizer(move);
      this.row= Integer.parseInt(tokenizer.nextToken());
      this.col= Integer.parseInt(tokenizer.nextToken()); */
    if (isValidMove(row,col)){
          player[xxx].takenSquare[row][col]=true;
          player[xxx].playerTable[row][col]=table[row][col];
      }
  
  }
  public static String drawTable(){
      if ( ( row &gt;= 0 &amp;&amp; row&lt;3 ) &amp;&amp; ( col &gt;=0 &amp;&amp;col &lt; 3 ) ){
      String a="";
      a+=(drawSquare(0,0)+"|");
      a+=(drawSquare(0,1)+"|");
      a+=(drawSquare(0,2)+'\n');
      a+=("-----------")+'\n';
      a+=drawSquare(1,0)+"|";
      a+=drawSquare(1,1)+"|";
      a+=(drawSquare(1,2)+'\n');
      a+=("-----------")+'\n';
      a+=drawSquare(2,0)+"|";
      a+=drawSquare(2,1)+"|";
      a+=(drawSquare(2,2));
  
      return a;
      } else return "error";
  
  }
  
  public static String drawSquare(int x,int y){
      if (player[0].isTaken(x,y)) {
          return " O ";
      }   else if (player[1].isTaken(x,y)) return " X ";
      else return "   ";  
  
  }
  public boolean isTaken(int x,int y) {
      return takenSquare[x][y];
  }
  </code></pre>