Printing the pattern using recursion (I am unable to find the error)

public class Pattern
{
public static void main(String[] args)
{
pattern(5,1,1);
}
public static void pattern(int n,int row, int col)
{
if(row>n)
{
return;
}
if(col>row)
{
System.out.println();
pattern(n, row+1, col);
return;
}
System.out.print(" *\t ");
pattern(n, row, col+1);
}

}

hey @jdkatti
Just a changes
public static void pattern(int n, int row, int col) {
if (row > n) {
return;
}
if (col > row) {
System.out.println();
pattern(n, row + 1, 1); // instead of pattern(n, row+1, col);
return;
}
System.out.print(" *\t ");
pattern(n, row, col + 1);
}

Sir, how do you find the errors so precisely?
I am unable to find them (sometimes) even after going through the program line by line

@jdkatti
Debug your code , you can find easily