Here you can find the source of getRandomStr(int qty)
public static String getRandomStr(int qty)
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { public static String getRandomStr(int qty) { String d = "abcdfghijklmnopqrtuvwxyz"; Random rand = new Random(); int i = 0; int n = 0; String f = ""; while (i < qty) { n = rand.nextInt(24 - 0 + 1) + 0; f += d.substring(n, n + 1);//from w w w .j a v a 2s . c o m i++; } return f; } }