title: Repeat an integer n times
body: <p>I'm trying to make a pyramid out of an integer.
  I.E the number 3 :</p>
  
  <pre><code>3
  33
  333
  </code></pre>
  
  <p>So based on the answers i found i made this :</p>
  
  <pre><code>int n = 8;
  String n2 = Integer.toString(n);
  
  for (int i=0; i&lt;n; i++) {
      System.out.println(StringUtils.repeat(n2, i));
  }
  </code></pre>
  
  <p>But it's not working and would be suboptimal. Is there a simple way to repeat an integer n times in the same line ?</p>
  
  <p>EDIT : made myself a method.. not quite happy either but it seems i can't just use something like System.out.println(int x, int n times)</p>
  
  <pre><code>int n = 8;
  
  for (int i=0; i&lt;=n; i++) {
      for (int j=0; j&lt;i; j++) {
          System.out.print(n + " ");
      }
      System.out.println("");
  }
  </code></pre>