Making a rectangular-shaped pattern
It's ok for a first iteration.


But your 2nd iteration should be drawRectangle(int width, int height). That will force you to not hard-code your numbers.
Your 3rd iteration should be noticing that your rectangle only has 2 different rows (one row fills up the width with * and the other only has * in the beginning and end).  You might want to make a method drawHorizontal to draw the top and bottom and drawEnds to draw the sides.  For example



    void drawHorizontal(int width) {
      for (int i=0 ; i&lt;width ; i++) {
         System.out.print("*");   /* notice I'm using print() not println() */
      }
      System.out.println("");     /* notice I'm using println() */
    }

    void drawEnds(int width) {
      System.out.print("*");
      for (int i=1 ; i&lt;width-1 ; i++) {
         System.out.print(" ");
      }
      System.out.println("*");
    }