title: How to make a diamond using nested for loops
body: <p>So I was assigned to make a diamond with asterisks in Java and I'm really stumped. Here's what I've come up with so far:</p>
  <pre class="lang-java prettyprint-override"><code>public class Lab1 {
      public static void main(String[] args) {
          for (int i = 5; i &gt; -5; i--) {
              for (int j = 0; j &lt; i; j++) {
                  System.out.print(&quot; &quot;);
              }
              for (int j = 0; j &gt;= i; j--) {
                  System.out.print(&quot; &quot;);
              }
              System.out.println(&quot;*&quot;);
          }
      }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/yWxp4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yWxp4.png" alt="output" /></a></p>