Here you can find the source of generateRandomNo()
public static String generateRandomNo()
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**/*from w ww .j av a2s . com*/ * It generates a random number and returns it as string. This is * normally used to be concatenated with the XML filename. * @return A random number. */ public static String generateRandomNo() { int id = 0; int range = Integer.MAX_VALUE / 3 * 2; Random rand = new Random(); for (int i = 0; i < 1000; i++) { id = rand.nextInt(range); } return Integer.toString(id); } }