title: Trouble getting return type from string builder in final method for word scramble game
body: <p>I have to make a word scrambler "game" and I have all the methods I need to use. I still need to put code in the main method for asking users guess and using .equals to see if its the right word. That's not a problem. I'm running into an issue on my scrambleWord(word) method. I used string builder and cannot figure out how to return. The code looks good and builds but says there is an error. Can anyone help? This is my code as of now. </p>
  
  <pre><code>import java.io.BufferedReader;
  import java.io.FileNotFoundException;
  import java.io.FileReader;
  import java.io.IOException;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.List;
  import java.util.Random;
  
   /**
   *
   * @author Brian2
   */
   public class Project3 {
  
  /**
   * @param args the command line arguments
   * @throws java.io.IOException
   */
  public static void main(String[] args) throws IOException {
  
      //Shuffle s = new Shuffle();
        //  s.shuffle("hello");
  
      String[] words = createListOfWords();
      String word = chooseRandomWord(words);
      String scrambledWord = scrambleWord(word);
      System.out.println(scrambledWord);
  
      /* code for asking userers guess
      *
      *use .equals
      *
      *
      */
  
  }
  double[] wordList = new double[65573];
  
  private static String[] createListOfWords() throws FileNotFoundException, IOException {
      BufferedReader in = new BufferedReader(new FileReader("wordlist.txt"));
      String str;
  
      List&lt;String&gt; list = new ArrayList&lt;String&gt;();
      while ((str = in.readLine()) != null) {
          list.add(str);
      }
  
      String[] stringArr = list.toArray(new String[0]);
  
      // test to see if array stored--System.out.println(Arrays.toString(stringArr));
      return stringArr;
  
  }
  
  /**
   *
   * @param words
   * @return
   */
  private static String chooseRandomWord(String[] words) {
  
      int index = new Random().nextInt(words.length);
  
      String word = words[index];
  
      return word;
  }
  
  private static String scrambleWord(String word) {
  
      char[] charArray = word.toCharArray();
  
  
  
          List&lt;Character&gt; characters = new ArrayList&lt;&gt;();
  
          StringBuilder scrambledWord = new StringBuilder(word.length());
  
              int randPicker = (int) (Math.random() * characters.size());
      StringBuilder append = scrambledWord.append(characters.remove(randPicker));
  
  
  
  
  /*for (int i = charArray.length - 1; i &gt; 0; i--) { 
   int j = ((int)(Math.random())(i + 1));
  
   double scrambledWord = charArray[i];
   charArray[i] = charArray[j];
   charArray[j] = (char) scrambledWord;
   }*/
  
  return scrambledWord.toString() ;
  /*This method should take a word as an argument, and return the 
   same word, except scrambled. In order to scramble a word, convert 
   it to an array of chars, like this:*/
      //char[] charArray = word.toCharArray();
  
   }
  
    }
  </code></pre>