Doubt about output

package Pattern;

import java.util.Scanner;

public class Patterrn2 {

public static void main(String[] args) {

// using with help of while loop

	Scanner scn=new Scanner(System.in);
	
	int n=scn.nextInt();
	
	int row=1;
	while(row<=n) {
		int col=1;
		while(col<=n) {
			System.out.println("*");
			
			col=col+1;
		}
		System.out.println("*");
		
		row=row+1;
	}
	
	
}

}

In This programme output not coming like in a video pattern 1




like this
my output coming like this if gave input 3
*
*
*
*
*
*

while(row<=n) {
		int col=1;
		while(col<=n) {
			System.out.print("*"); ///////// not println only print
			col=col+1;
		}
		System.out.println();    //just emplty println no * required	
		row=row+1;
	}

if this solves your doubt please mark it as resolved :slight_smile: