Why does this recursive code print "1 2 3 4 5"? : <p>I am new to Recursion in Java and came across this code in a textbook. After running the code it prints "1 2 3 4 5" and am wondering why it doesn't print "5 4 3 2 1"?</p>

<pre><code>public class Test {
  public static void main(String[] args) {
    xMethod(5);
  }

  public static void xMethod(int n) {
    if (n &gt; 0) {
      xMethod(n - 1);
      System.out.print(n + " ");
    }
  }
}
</code></pre>
