Is My Code Correct too?

Before Sir started the explanation , I wrote this

public static void P_Fall (int n) {
if ( n > 1 ) {
P_Fall (n-1) ;
}
System.out.println(n);
}

Is this code also correct , I mean I tested it and it gives the same answer but i want to ask that is this also a right way to do Recursion (work done when falling) or not.
Thank You ,
Brahat

@brahatsingh32 Ofcourse you are doing the same work just that instead of negative base case you implemented it with a positive base case. Rest is same.

For example if n = 4 , the stack will be filled like this 4 -> 3 -> 2 -> 1(now will not execute that if) flow will go to print and will print 1.
Then stack will fall, executing immediate next line for print i.e 2 then again fall print 3 then again print 4. and now the control will again return to main.

If your doubt is clear mark it resolved and rate it. Also my advice is making recursion tree for initial questions and if you have any doubt feel free to ask!