public static String generateRandomWord(int n){
  int chars=random.nextInt(n - 1);
  StringBuilder result=new StringBuilder(chars);
  for (int i=0; i < chars + 1; i++) {
    result.append(WORD_CHARS.charAt(random.nextInt(WORD_CHARS.length())));
  }
  return result.toString();
}

public static String generateRandomWord ( int n ) { int chars = random . nextInt ( n - 1 ) ; StringBuilder result = new StringBuilder ( chars ) ; for ( int i = 0 ; i < chars + 1 ; i ++ ) { result . append ( WORD_CHARS . charAt ( random . nextInt ( WORD_CHARS . length ( ) ) ) ) ; } return result . toString ( ) ; }
generates a random word between 1 and n chars in length .
