Here you can find the source of generateRandomNum(int passNumber)
private static int generateRandomNum(int passNumber)
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { private static int randomNum; private static Random rn = new Random(); private static int generateRandomNum(int passNumber) { int range = passNumber + 1; randomNum = rn.nextInt(range);//from w w w . j a v a2 s. com return randomNum; } }