My function works before writing my function definition

How is it explained in this question of Print Increasing
order. Its no explained properly

Hi @PoojaSingh22,
See thee video is quite basic and i will suggest you to go through that again you are unable to understand . And also try doing it using paper and pencil along with the video .
For the explaination :- consider the function call the be sort of windows . so when you run PI(n) then it goes to call PI(n-1) inside the function … So that is like window opening inside a window and running the function all over again . For the dry run lets take n to be 5. so in this case PI(n) will be called with n=5 and then inside PI(5) we will call PI(n-1) which is PI(4) . So now we are in PI(4) but the function PI(5) is not over yet … PI(5) is waiting for PI(4) to be completed … PI(4) will call PI(3) and wait for the completion of PI(3) and so on till the base case is reached … After the base case is reached each function will end and then output the system.out.println statement … So we will get
1
2
3
4
5
as our output