In this section well produce more complex output by wrapping
Solution
package org.students;
import java.util.Scanner;
public class StraightLine {
   public static void main(String[] args) {
        // Scanner class object is used to read the inputs entered by the user
        Scanner sc = new Scanner(System.in);
       // Getting the number entered by the user
        System.out.print(\"Enter a number :\");
        int size = sc.nextInt();
        System.out.println(\"\ \");
       // Displaying the Lines
        for (int i = 1; i <= size; i++) {
            for (int j = 1; j <= size; j++) {
                System.out.print(\"* \");
            }
            System.out.println(\" \");
        }
}
}
____________________________________
output:
Enter a number :4
 * * * *
 * * * *
 * * * *
 * * * *
______________________________
output:
Enter a number :5
 * * * * *
 * * * * *
 * * * * *
 * * * * *
 * * * * *
_____________Thank You


