title: where are the method return and parameters stored in memory in java
body: <p>I have trouble understanding the return types of a method in java. Where is it supposed to be? On the stack or heap?
  Let's take this example snippet:</p>
  
  <pre><code>/** the snippet returns the minimum between two numbers */
      public int minFunction(int n1, int n2) {
         int min;
         if (n1 &gt; n2){
            min = n2;
         }else{
            min = n1;
            return min; 
            }
         }
  </code></pre>
  
  <p>how and where are minFunction, n1, n2, min stored in memory. if i call the method with the numbers 3 and 5 what will happen?</p>