Print star using star pattern Java
<p>I want to print the below pattern</p>

<pre>
       *       
***************
 *   *   *   * 
  * *     * *  
   *       *   
  * *     * *  
 *   *   *   * 
***************
       *        
</pre>

<p>I am able to print the two outer pyramids in the pattern using the below code:</p>

<pre><code>    public static void main(String[] args) {
    int n = 8;
    int i, j;

    for (i = 1; i &lt;= n; i++) {
        for (j = i; j &lt; n; j++) {
            System.out.print(" ");
        }
        for (j = 1; j &lt;= (2 * i - 1); j++) {
            if (i == n || j == 1 || j == (2 * i - 1)) {
                System.out.print("*");
            } else {
                System.out.print(" ");
            }
        }

        System.out.print("\n");

    }
    for (i = n; i &gt;= 1; i--) {
        for (j = i; j &lt; n; j++) {
            System.out.print(" ");
        }
        for (j = 1; j &lt;= (2 * i - 1); j++) {
            if (i == n || j == 1 || j == (2 * i - 1)) {
                System.out.print("*");
            } else {
                System.out.print(" ");
            }
        }
        System.out.print("\n");
    }
}
</code></pre>

<p>This prints the pattern as</p>

<pre>
       *               
      * *              
     *   *             
    *     *             
   *       *           
  *         *              
 *           *
***************
***************
 *           *
  *         *
   *       *
    *     *
     *   *
      * *
       *``
</pre>

<p>But how to combine these two to form a star shape?</p>