Subject : 8 queens, when im printing out the board its giving me five copies and i want only one?
<p>Output</p>

<pre><code>Q   x   x   x   x   x   x   x   
    x   x   Q   x   x   x   x   

x   x   x   Q   x   x   x   x   
x   x   x   x   x   x   Q   x   
x   x   Q   x   x   x   x   x   
x   x   x   x   x   x   x   Q   
x   Q   x   x   x   x   x   x   
x   x   x   x   Q   x   x   x   
Q   x   x   x   x   x   x   x   
    x   x   x   x   Q   x   x   

x   x   x   Q   x   x   x   x   
x   Q   x   x   x   x   x   x   
x   x   x   x   x   x   Q   x   
x   x   Q   x   x   x   x   x   
x   x   x   x   x   Q   x   x   
x   x   x   x   x   x   x   Q   
x   x   x   x   Q   x   x   x   
Q   x   x   x   x   x   x   x   

x   x   x   x   Q   x   x   x   
x   Q   x   x   x   x   x   x   
x   x   x   Q   x   x   x   x   
x   x   x   x   x   x   Q   x   
x   x   Q   x   x   x   x   x   
x   x   x   x   x   x   x   Q   
x   x   x   x   x   Q   x   x   
Q   x   x   x   x   x   x   x   

x   x   Q   x   x   x   x   x   
x   x   x   x   Q   x   x   x   
x   Q   x   x   x   x   x   x   
x   x   x   x   x   x   x   Q   
x   x   x   x   x   Q   x   x   
x   x   x   Q   x   x   x   x   
x   x   x   x   x   x   Q   x   
Q   x   x   x   x   x   x   x   

x   x   Q   x   x   x   x   x   
x   x   x   x   x   Q   x   x   
x   x   x   Q   x   x   x   x   
x   Q   x   x   x   x   x   x   
x   x   x   x   x   x   x   Q   
x   x   x   x   Q   x   x   x   
x   x   x   x   x   x   Q   x   
Q   x   x   x   x   x   x   x   
</code></pre>

<p>Code</p>

<pre><code>public class ChessV2

{
    static String[][] board = new String[8][8];


   public static void main(String[] args)

   {

           for(int i = 0; i &lt; board.length; i++)
       {
                for(int j = 0; j &lt; board.length; j++)
                {
                    board[i][j] = " ";
                }
       }

      placeQueens(0);    
    }


   public static boolean placeQueens(int column)

    {

        boolean placed = false;

        if(column == 8)
        {

            System.out.println();
            for(int i = 0; i &lt; board.length; i++)
            {
                for(int j = 0; j &lt; board.length; j++)
                {
                    System.out.print(board[i][j] + "   ");
                }
                System.out.println();

            }
            placed = false; 
        }





        else
        {
          for(int i = 0; i &lt; 8; i++)
          {
             if(!checkForQueens(i,column))
             {
                board[i][column] = "Q";

                if(placeQueens(column + 1) == true)
                {
                     placed = true;

                }

                else
                {
                    placed = false;
                   board[i][column] = "x";
                    }
             }
          }
        }

        return placed;
    }


   public static boolean checkForQueens(int row, int column)

    {
        boolean placeTaken = false;
        int newCol =0;
        int newRow;

        for(newRow = row - 1; newRow &gt;= 0; newRow--) // vertically above the queen
        {

            if(board[newRow][column].equals("Q"))
                placeTaken = true;
        }

        for(newRow = row + 1; newRow &lt; board.length; newRow++) // vertically under the queen
        {
            if(newRow &gt;= 8 || column &gt;= 8)
                break;

            if(board[newRow][column].equals("Q"))
                placeTaken = true;
        }

        for(newCol = column + 1; newCol &lt; board.length -1; newCol++) // horizontally to the right of the queen
        {


            if(board[row][newCol].equals("Q"))
                placeTaken = true;
        }

         for(newCol = column - 1; newCol &gt;= 0; newCol--) // horizontally to the left of the queen
        {


            if(board[row][newCol].equals("Q"))
                placeTaken = true;
        }

        newCol = column + 1;
        for(newRow = row - 1; newRow &gt;= 0; newRow--) // Queen's upper right diagonal
        {
            if(newRow &gt;= 8 || newCol &gt;= 8)
                break;

            if(board[newRow][newCol].equals("Q"))
                placeTaken = true;

            newCol++;    
        }

        newCol = column + 1;
        for(newRow = row + 1; newRow &lt; board.length - 1; newRow++) // Queen's lower right diagonal
        {
            if(newRow &gt;= 8 || newCol &gt;= 8)
                break;

            if(board[newRow][newCol].equals("Q"))
                placeTaken = true;

            newCol++;    
        }

        newCol = column - 1;
        for(newRow = row - 1; newRow &gt;= 0; newRow--) // Queen's upper left diagonal
        {
            if(newRow &lt; 0  || newCol &lt; 0)   
                break;

            if(board[newRow][newCol].equals("Q"))
                placeTaken = true;

            newCol--;    
        }

        newCol = column - 1;
        for(newRow = row + 1; newRow &lt; board.length; newRow++) // Queen's lower left diagonal
        {
            if(newRow &lt; 0  || newCol &lt; 0)
                break;

            if(board[newRow][newCol].equals("Q"))
                placeTaken = true;

            newCol--;    
        }

        return placeTaken;
    } 

   public static void print(String[][] array)
   {
       for(int i = 0; i &lt; array.length; i++)
       {
           for(int j = 0; j &lt; array.length; j++)
           {
                    System.out.println(array[i][j] + "   ");
           }


       }
    }



}  
</code></pre>
