import java.util.Random; /** * Class for generating random phrases * @author dtwitch * */ public class PhraseGenerator { private static String[] phrases = new String[]{ "logarithm", "elephant", "pride and prejudice", "first and foremost", "under the weather", "around the world", "you light up my life", "the matrix", "lord of the rings", "harry potter", "hang ten", "football", "marching band", "the west wing", "commander in chief", "battlestar galactica", "computer programming", "stoplight", "go for the goal", "meet the parents", "illinois state university", "gone with the wind" }; private static Random random = new Random(); public PhraseGenerator(){ } /** * Returns a random phrase * @return returns a random phrase as a String */ public String getRandomPhrase(){ return phrases[random.nextInt(phrases.length)].toUpperCase(); } }