Here you can find the source of getNumber(int length)
private static String getNumber(int length)
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { public static Random random = new Random(); private static String getNumber(int length) { String sRand = ""; for (int i = 0; i < length; i++) { String rand = String.valueOf(random.nextInt(10)); sRand += rand;/*w w w . j a v a2 s. c o m*/ } return sRand; } }