Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Square star pattern in java

class squarePattern {
  public static void main(String[] args) {

    // size of the square
    int size = 5;
    // outer loop
    for (int i = 0; i < size; i++) {
      // inner loop
      for (int j = 0; j < size; j++) {
        System.out.print("*");
      }
      System.out.println();
    }
  }
}
Source by www.tutorialstonight.com #
 
PREVIOUS NEXT
Tagged: #Square #star #pattern #java
ADD COMMENT
Topic
Name
7+9 =