title: Asterisk in Nested loops, Java
body: <p>I am trying to make my code print out the Asterisk in the image, you see below. The Asterisk are align to the right and they have blank spaces under them. I can't figure out, how to make it go to the right. Here is my code:</p>
  
  <pre><code>public class Assn4 {
      public static void main(String[] args) {
          for (int i = 0; i &lt;= 3; i++) {
              for (int j = 0; j &lt;= i; j++) {
                  System.out.print("*");
              }
  
              for (int x = 0; x &lt;= 1; x++) {
                  System.out.println(" ");
              }
  
              for (int j = 0; j &lt;= i; j++) {
                  System.out.print("*");
              }
          }
          System.out.println();
      }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/6RddT.png" alt="enter image description here"></p>