title: Recursive function to generate all combinations of capitals in a word
body: <p>Does anyone know the logic behind creating a recursive function to generate all combinations of capitals in a given word? I'm trying to do this in Java... For exmaple, give it the word "ben" and it outputs:</p>
  
  <pre><code>Ben
  bEn
  beN
  BEn
  BeN
  bEN
  BEN
  </code></pre>
  
  <p>But for any length word... any help appreciated!</p>