title: triangle numbers in java
body: <p>I am new to Java and now I want to learn better for loop. I made some examples , but I don't know how to do a triangle that look like this:
   for n=6: </p>
  
  <pre><code>111111 
  22222
  3333
  444
  55
  6
  </code></pre>
  
  <p>My code until now:</p>
  
  <pre><code>class Pyramid
  {
  public static void main (String[] args)
  {
     int i,n=9,j; 
     for(i=1;i&lt;=n;i++)
     {
         for(j=1;j&lt;=i;j++)  {          
  System.out.print(i); }      
  System.out.print("\n");        
  }}}
  </code></pre>
  
  <p>But what I managed to do it looks like this:</p>
  
  <pre><code>1
  22
  333
  4444
  55555
  666666
  </code></pre>
  
  <p>How to make it in reverse order ?</p>