Here you can find the source of getRandomNumber(int randomCount)
public static String getRandomNumber(int randomCount)
//package com.java2s; import java.util.Random; public class Main { public static String getRandomNumber(int randomCount) { Random random = new Random(); StringBuilder sb = new StringBuilder(randomCount); for (int i = 0; i < randomCount; i++) sb.append((char) ('0' + random.nextInt(10))); return sb.toString(); }//from w w w .j a va 2 s . c o m }