title: How does a for-each loop work?
body: <p>How does a for-each loop works when it calls a method, either recursively or a different method?</p>
  
  <p>Example:</p>
  
  <pre><code>for(String permutation : permute(remaining))
      {   
  
        // Concatenate the first character with the permutations of the remaining chars
        set.add(chars.charAt(i) + permutation);
      }
  </code></pre>
  
  <p>By the way the method <b> permute </b> takes in a String and returns a set.</p>
  
  <p>Thank you.</p>