Java recursion executing after return statement : <p>I would like to know why my recursive method executes even after it has executed the <code>return</code> statement. I am trying to write a simple program to calculate the factorial of the input, but the factorial of "4" returns "48" because it multiplies the "2" twice. Please find my code below.</p>

<pre><code>import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {

   static int soln=0; 
   static boolean start = true;

    public static void main(String[] args) {
        Scanner sn = new Scanner(System.in);
        int n=sn.nextInt();
        System.out.println(multx(n));
    }

    public static int multx(int n){
      if (start){
         soln = n;
         start = false;
      }

      while(n&gt;2)
      {
         n--;
         soln = soln*n;
         multx(n);
      }
       return soln;
    }
}
</code></pre>

<p>Why does it execute <code>return soln</code> and then go back to <code>multx(n)</code>?</p>
