Here you can find the source of random(int start, int end)
public static int random(int start, int end)
//package com.java2s; //License from project: Open Source License public class Main { public static int random(int start, int end) { return (int) Math.round(Math.random() * (end - start - 1)) + start; }/*from w w w . j a v a 2 s .com*/ }