Pattern problem 7

can you please tell my mistake in the code

hey @kalindiyadav5
plzzz
code copy past and send it

package lecture1;

import java.util.Scanner;

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

Scanner scn = new Scanner(System.in);
int n= scn.nextInt();



//row

int row =1;
while(row<=n) {

	//for stars
	for(int cst=1; cst<=n; cst++) {
		
		if(row==1 || row==n  ) {
			System.out.print("*");
			
		}else {
			 if (cst==1||cst==n) {
				 System.out.print("*");
			 }else {
				 System.out.print(" ");
			 }
			
		}
		
	}
	System.out.println();
	row++;
	
}

}
}

i am getting this output

@kalindiyadav5
You asked doubts form the number system lecture. Tell me what is the actual pattern

@kalindiyadav5
code is fine
just put space between two start and Space
import java.util.Scanner;

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

	Scanner scn = new Scanner(System.in);
	int n = scn.nextInt();

//row
int row = 1;
while (row <= n) {

		// for stars
		for (int cst = 1; cst <= n; cst++) {

			if (row == 1 || row == n) {
				System.out.print("* ");

			} else {
				if (cst == 1 || cst == n) {
					System.out.print("* ");
				} else {
					System.out.print("  ");
				}

			}

		}
		System.out.println();
		row++;

	}
}

}

System.out.print(" ");//put 2 space

Yes , now it is coming. thank you

@kalindiyadav5

Please mark your doubts as resolved in your course’s.