Original Post
My Program compiles but I keep on getting a Illegal Argument Exception: n must be positive. randomgenerator is a instance variable of the current class (WordArray). Code snippet below: public String randomWord() { int rand; // random number String str = new String(); rand = randgenerator.nextInt(num); // A random number is assigned to the variable rand str = getWord(rand).getSpell(); // str holds the spelling of a psuedorandom word return str; }