Here you can find the source of randomNum(int number)
private static String randomNum(int number)
//package com.java2s; //License from project: Apache License public class Main { private static String randomNum(int number) { StringBuffer result = new StringBuffer(); for (int i = 0; i < number; i++) { int random = (int) (Math.random() * 10); result.append(random);//w w w .jav a 2 s .c o m } return result.toString(); } }