Here you can find the source of getRandomNumber()
public static int getRandomNumber()
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { private static final Random RANDOM = new Random(); /**/*w ww .j av a2 s . c om*/ * @return 4 digit random Integer number */ public static int getRandomNumber() { return RANDOM.nextInt(10000); } /** * @return random Integer number between 0 and parameter max */ public static int getRandomNumber(int max) { return RANDOM.nextInt(max); } }