So here is a simple example of recursion where we count down from a number. When clicking run does java calculate 5,4,3,2,1,0 store those numbers in 6 stack frames only then does it print the code? Or maybe it calculates 5, adds it to call stack, 4 adds it to call stack etc...
public static void main(String[] args) {
countDown(5);
}
public static void countDown(int n){
if(n <= 0){
System.out.println(n);
}
else{
System.out.println(n);
--n;
countDown(n);
//Call stack pops 5 times from the 5 calls from here up until the method call
//Test will print 5 times
System.out.println("Test");
}
}