Here you can find the source of getRandomString()
public static String getRandomString()
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { public static String getRandomString() { Random random = new Random(); int randomName = random.nextInt(99999999); return "" + randomName; }//from w w w . j av a 2 s . c o m public static String getRandomString(int len) { int seed = 10 ^ len - 1; Random random = new Random(); int randomName = random.nextInt(seed); return "" + randomName; } }