Java tutorial
//package com.java2s; import java.util.Random; public class Main { static String GenRandomNumber(int iLen) { String s = ""; for (int i = 0; i < iLen; ++i) { int r = new Random().nextInt(10); s += String.valueOf(r); } return s; } }