Here you can find the source of getRandomNumericString(int maxlen)
public static String getRandomNumericString(int maxlen)
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { private static Random R = new Random(); public static String getRandomNumericString(int maxlen) { String str = new String(); for (int j = 0, n = R.nextInt(maxlen) + 1; j < n; ++j) { str += (char) ('0' + R.nextInt(10)); }/*w w w .j a v a 2 s.com*/ return str; } }