Here you can find the source of generateRandomNumber(int length)
public static String generateRandomNumber(int length)
//package com.java2s; import java.util.*; public class Main { public static String generateRandomNumber(int length) { Random random = new Random(); String val = ""; for (int i = 0; i < length; i++) { val += String.valueOf(random.nextInt(10)); }/*w w w.ja v a 2s. com*/ return val; } }