Here you can find the source of generateRandomString()
public static String generateRandomString()
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { /**/*from w w w .jav a 2 s .c om*/ * Gnerate a new random string * @return Random string */ public static String generateRandomString() { String str = ""; for (int i = 0; i < 10; i++) str += new Random().nextInt(); return str; } }