title: Java permutations of an array
body: <p>I have an array :</p>
  
  <pre><code>String wordArr[]=new String[3];
  
      [1 2 3]
  </code></pre>
  
  <p>I want to form arrays with all combinations of the above.</p>
  
  <p>Say.,</p>
  
  <p>123
  132
  213
  231
  321
  312</p>
  
  <p>Can anyone give me an idea on how to find the number of arrays needed and logic in java ?</p>
  
  <p>Am figuring out on how to iterate through an array with all possible combinations. Say if i iterate for the first time with 123 then next time i should iterate through 132 and 213 and so on...</p>