title: How to randomly print asterisk on a grid using user input
body: <p><strong>Project objective:</strong> Take user input. The asterisk are randomly placed and can only have one per section.</p>
  
  <p>Error : can't print asterisk. I have tried <code>System.out.println('*');</code> but then the grid becomes destroyed.I also am not sure how to set it to match user input to randomly place the asterisk.</p>
  
  <p>What Output should look like:</p>
  
  <p><a href="https://imgur.com/CKkuMTc" rel="nofollow noreferrer">https://imgur.com/CKkuMTc</a></p>
  
  <pre><code>    import java.util.Scanner;
      import java.util.Random;
  
      public class project {
      public static void main(String[] args) {
          Scanner sc = new Scanner(System.in);
          int rows = 0;
          while (rows &lt; 1 || rows &gt; 9) {
              System.out.println("rows? ");
              rows = sc.nextInt();
          }
          int columns = 0;
          while (columns &lt; 1 || columns &gt; 9) {
              System.out.println(" columns?");
              columns = sc.nextInt();
              int length = 0;
              System.out.println("side length?");
              length = sc.nextInt();
              System.out.print("  " + "|");
              for (int j = 0; j &lt; columns; j++) {
                  System.out.print("   " + j);
              }
              System.out.println();
              for (int j = 0; j &lt;= columns; j++) {
                  System.out.print("----");
              }
              System.out.println();
              int[][] board = new int[rows][columns];
              Random rand = new Random();
              for (int i = 0; i &lt; rows; i++) {
                  System.out.print(i + "  |");
                  for (int j = 0; j &lt; columns; j++) {
                      board[i][j] = printChar('*');
                      System.out.print("   " + board[i][j]);
                  }
                  System.out.println();
  
              }
          }
      }
  }
  </code></pre>