Here you can find the source of randInt(int range)
public static int randInt(int range)
//package com.java2s; //License from project: Open Source License public class Main { public static int randInt(int range) { if (range < 1) { return 0; }/*w w w. j av a 2 s.com*/ return (int) (Math.random() * range); } public static int random(int min, int max) { return Math.round((float) Math.random() * (max - min)) + min; } }