title: How to turn java for loops into recursion?
body: <p>I have three for loops, and I wish to turn them into recursive method because I want to do this for any amount of for loops. I searched online, but nobody seems to have exactly what I need, for example this guy turns recursion into for loops
  <a href="https://stackoverflow.com/questions/4956336/turning-a-recursive-function-into-a-for-loop">Turning a recursive function into a for loop?</a>
  Code:</p>
  
  <pre><code>    int x = 3;
      for (int i = 0; i &lt; x; i++) {
          for (int j = 0; j &lt; x; j++) {
              for (int k = 0; k &lt; x; k++){
                  list.add(array[i] + array[j] + array[k]);
               }
          }
      }
  </code></pre>