title: printing an empty square using loops
body: <p>I need to print an empty square and my code prints this instead, and I have no idea why.</p>
  
  <pre><code>        ******
          *    *
          *    *
          *    *
          *    *
          ******
  </code></pre>
  
  <p>Can you explain why it's a rectangle and not a square and how can I fix it? </p>
  
  <p>This is my code: </p>
  
  <pre><code>    public static void main(String[] args) {
          // TODO Auto-generated method stub
          int m = 6;
          for (int i = 1; i &lt;= m; i++) {
              for (int j = 1; j &lt;= m; j++) {
                  if (i == 1 || i == m)
                      System.out.print("*");
                  else if (j == 1 || j == m)
                      System.out.print("*");
                  else
                      System.out.print(" ");
              }
              System.out.println();
          }
      }
  </code></pre>