Here you can find the source of randomInRange(int min, int max)
public static int randomInRange(int min, int max)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.ThreadLocalRandom; public class Main { public static int randomInRange(int min, int max) { int random = ThreadLocalRandom.current().nextInt(min, max + 1); return random; }//from ww w . ja va 2 s.c o m }