For this Question: Perform the loop operation to create a square pattern for the given number of rows.

<b>Example</b>
number of rows = 5
*****
* *
* *
* *
*****The only line contains the integer "size" denoting the number of rows.

<b>Constarints</b>
1 &le; size &le; 7Print the square pattern.Sample input:
4

Sample output:
*****
* *
* *
*****, I have written this Solution Code: import java.util.Scanner;
public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int size = sc.nextInt();
     assert(size >= 1 && size <= 7);
      for(int i = 1; i <= size; i++) {
         for(int j = 1; j <= size; j++) {
            if(i == 1 || i == size || j == 1 || j == size) {
               System.out.print("*");
            } else {
               System.out.print(" ");
            }
         }
         System.out.println();
      }
   }
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?