title: Turning a iteration into a recursion
body: <p>Good day!</p>
  
  <p>I just wrote a code as an iteration which is supposed to sum up even numbers in between 0 and y.</p>
  
  <p>I've been sitting now on my desk for about two hours thinking on how to write the same code in a recursion - without any progress so far.
  The only explanations I find on the internet explain it for one simple repeat of one specific change - unlike my code which includes two. ("result = result + x;" and "x = x + 2;" )
  Could someone please explain to me how I turn this kind of iteration into a recursion? Thanks in advance!</p>
  
  <pre><code> public class Sum {
  
     static int method(int y) { 
       int result = 0; 
       for (int x = 2; x&lt;=y;)
       {
          result = result + x;   
          x = x + 2; 
       }
       return result;
     } 
  
     public static void main(String[ ] args) {
        int result = method(35); 
        System.out.println("Sum of even numbers between 0-35: " +result); 
     }
  }
  </code></pre>