Here you can find the source of RandInt(int x, int y)
static public int RandInt(int x, int y)
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { static private Random rand = new Random(); static public int RandInt(int x, int y) { assert y >= x : "<RandInt>: y is less than x"; return rand.nextInt() % (y - x + 1) + x; }/*from www . ja v a 2 s .c om*/ }