Here you can find the source of getRandomString(int len)
public static String getRandomString(int len)
//package com.java2s; import java.util.Random; public class Main { public static String getRandomString(int len) { String returnStr = ""; char[] ch = new char[len]; Random rd = new Random(); for (int i = 0; i < len; i++) { ch[i] = (char) (rd.nextInt(9) + 97); }/*from w w w. ja v a 2 s.c om*/ returnStr = new String(ch); return returnStr; } }