title: Generate all permutations in Java
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4240080/generating-all-permutations-of-a-given-string">Generating all permutations of a given string</a>  </p>
  </blockquote>
  
  
  
  <p>I have an array of arbitrary length in Java, and I would like to generate all possible permutations of them. The easy way to do this for a fixed length would be a series of nested for loops, but because the array is of unknown length, that is not an option here. Is there a straightforward way to accomplish this in Java?</p>