Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { /** * Get a random number between a min and max * @param min lower end min * @param max higher end max * @return */ public static int getRandomInt(int min, int max) { Random rand = new Random(); int randomNum = rand.nextInt((max - min) + 1) + min; return randomNum; } }