title: How can I shuffle the letters of a word?
body: <p>What is the easiest way to shuffle the letters of a word which is in an array? I have some words in an array and I choose randomly a word but I also want to shuffle the letters of it.</p>
  
  <pre><code>public static void main (String[] args ) {
      String [] animals = { "Dog" , "Cat" , "Dino" } ;    
      Random random = new Random();
      String word = animals [random.nextInt(animals.length)];
  
      System.out.println ( word ) ;
      //I Simply want to shuffle the letters of word     
  }
  </code></pre>
  
  <p>I am not supposed to use that List thing. I've come up with something like this but with this code it prints random letters it doesn't shuffle. Maybe I can code something like do not print if that letter already printed? </p>
  
  <pre><code>//GET RANDOM LETTER
  for (int i = 0; i&lt; word.length(); i++ ) {
  
  char c = (word.charAt(random.nextInt(word.length())));
  System.out.print(c); } 
    }
  </code></pre>