Hi, I was if someone could explain how this code works after it reaches the return line. I understand that the flow of control returns to the print statement after recurse(v). But I don't understand why it prints "wo" right after and why the code loops and prints "wor", "worl" and "world" instead of terminating.

Thanks in advance!

public class Recursion {
public static void main(String[] args) {
recurse("world");
}
public static void recurse(String w) {
int l = w.length();
if(l == 1) {
System.out.println(w);
return;
}
System.out.println(w);
String v = w.substring(0, l-1);
recurse(v);
System.out.println(w);
}
}

Output:
world
worl
wor
wo
w
wo
wor
worl
world