So I am working on learning how to utilize recursion through Java. I have written a simple program that adds all the numbers between 1 and n and it looks to do it\'s job. Wh
When the recursion is stack is full, then it starts emptying itself from the tail. This is the reason your print statement below the if statements starts to get executed. Note: Recursion process will return its value where its called, so if conditions arent satisfied so it will return to that point, but the whole recursion process will keep on continuing until the stack is emptied. Whatever i said is what is called the Tail Recursion.