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