Q:

Java method executes last print statement three times even though the method is only called once

I'm trying to figure out why this mystery method in Java prints out "43211234". I understand how the program reaches "43211" but I'm not sure how the last System.out.print(x % 10) after the "if" is ran 3 times and for each time, it brings the value of x back to the value it was previous to its current one until it reaches "1234" as the value of x. Could this have something to do with recursion since the method is being called in the "if" 3 times? I'm guessing it's something along those lines because the last executes exactly 3 times as well. I would greatly appreciate your help. Thanks.   
class Main {
    public static void main(String[] args) {
    mystery(1234);
}
public static void mystery(int x) {
    System.out.print(x % 10);
    if((x / 10) != 0) {
        mystery(x / 10);
    }
    System.out.print(x % 10);
  }
}

A:

I understand how the program reaches "43211"

so you know what recursion is. 
Everytime mystery() is called, the 1st print is called and then it calls (recursively) itself, before the 2nd print.  
When the recursion stops because (x / 10) != 0 is false, the 2nd print is called for the 1st time and then goes back to the previous unfinished recursive calls and executes the remaining print for each one.

