public static String generateRandomString(int count){
  Random random=new Random();
  StringBuffer buffer=new StringBuffer();
  while (count-- != 0) {
    char ch=(char)(random.nextInt(96) + 32);
    buffer.append(ch);
  }
  return buffer.toString();
}

public static String generateRandomString ( int count ) { Random random = new Random ( ) ; StringBuffer buffer = new StringBuffer ( ) ; while ( count -- != 0 ) { char ch = ( char ) ( random . nextInt ( 96 ) + 32 ) ; buffer . append ( ch ) ; } return buffer . toString ( ) ; }
generate a random string . this is used for password encryption .
