Here you can find the source of genRandomNumber(int digitNumber)
public static String genRandomNumber(int digitNumber)
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { public static String genRandomNumber(int digitNumber) { StringBuilder num = new StringBuilder(); Random random = new Random(); for (int i = 0; i < digitNumber; i++) { num.append(random.nextInt(10)); }/*w ww .ja va 2 s . com*/ return num.toString(); } }