title: I'm trying to pull a random word from a string. Java
body: <p>I was given the assignment to pull a random word from a string. All the words have the same letters. The tools that I have gathered so far are: primative data types, and their methods. So far I have:</p>
  
  <pre><code>import java.util.Random;
  
  public class HolyCow {
  
      public static void main(String[] args) {
  
          String threeLetterWords = "cat nat bat sat fat ";
          String newString = new String(threeLetterWords);
          int newStringLength = newString.length();
          int firstWord = newString.indexOf("cat ");
          int secondWord = newString.indexOf("nat ");
          int thirdWord = newString.indexOf("bat ");
          int fourthWord = newString.indexOf("sat ");
          int fifthWord = newString.indexOf("fat ");
          Random randomWord = new Random();
          System.out.print("Printing a random substring: " 
                  + randomWord.nextInt(0 (newStringLength / 4)));
  
      }
  
  }
  </code></pre>
  
  <p>Thank you for your time and consideration.</p>