public static String generateStringOfLength(int length){
  StringBuilder sb=new StringBuilder();
  while (--length >= 0) {
    sb.append((char)(random.nextInt(52) + 65));
  }
  return sb.toString();
}

public static String generateStringOfLength ( int length ) { StringBuilder sb = new StringBuilder ( ) ; while ( -- length >= 0 ) { sb . append ( ( char ) ( random . nextInt ( 52 ) + 65 ) ) ; } return sb . toString ( ) ; }
generate a random string of the specified length .
