title: How do I print an array multiple times?
body: <p>My following code is mostly somebody else's, I was able to figure out how to print the correct range, but now I want to print that range (array) multiple times. </p>
  
  <pre><code>    public class lottery {
      public static void main(String[] args) {
  
      int[] lottery = new int[6];
      int randomNum;
  
      for (int i = 0; i &lt; 6; i++) {
          randomNum = (int) Math.ceil(Math.random() * 59); // Random number created here.
          for (int x = 0; x &lt; i; x++) {
              if (lottery[x] == randomNum) // Here, code checks if same random number generated before.
              {
                  randomNum = (int) Math.ceil(Math.random() * 59);// If random number is same, another number generated.
                  x = -1; // restart the loop
              }
  
          }
          lottery[i] = randomNum;
      }
  
      for (int i = 0; i &lt; lottery.length; i++)
          System.out.print(lottery[i] + " ");
  
      }    
  }
  </code></pre>
  
  <p>The output, as expected is six integers in a row:</p>
  
  <pre><code>12 52 46 22 7 33
  </code></pre>
  
  <p>I have unfortunately not been able to find anything directly relevant to my question. I am an absolute Java beginner, so please be gentle. </p>
  
  <p>The output I want is as follows, where each x is a random number.</p>
  
  <pre><code>    x x x x x x
      x x x x x x
      x x x x x x
      x x x x x x
      x x x x x x
  </code></pre>
  
  <p>Technically, I'd like for the last number to be a random number, but a smaller range. I'll burn that bridge another time.</p>