title: Different variations for using loops to a pattern in java
body: <p>I have been trying different variations of for loops and have no clue how to make these patterns:</p>
  
  <p>Pattern </p>
  
  <pre><code>1
  121
  12321
  1234321
  </code></pre>
  
  <p>My code  is the following but doesn't work like the example above.</p>
  
  <pre><code>for (int i = 1 ; i &lt;= rows ; i++) {
      for (int j = (rows + 1 - i) ; j  &gt; 0 ; j-- ) {
          System.out.print(j);
      }   
      System.out.print("\n");
   }
  </code></pre>