Here you can find the source of getRandomStr(int n)
private static String getRandomStr(int n)
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { private static String getRandomStr(int n) { String s = ""; Random random = new Random(); for (int i = 0; i < n; i++) { s = s + random.nextInt(10);/* w ww . ja v a 2 s . co m*/ } return s; } }