Alternative code for this problem

public static void printPattern(int n , int row , int col) {

	if(row == n )
		return;

	while(row > col) {
		System.out.print("*");
		col++;
	}
	col = 0;
	System.out.println("*");
	printPattern(n,row+1,col);
}

Hi Team,
I have written an alternative code for this problem , can u please verify whether this is also good

@mt2016127 Hi bro, the logic is correct but as you can see in the video that you can be asked to print pattern without using a single loop, then that logic will be handy.
Also bro mark the doubt resolved.
Happy coding!