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