Here you can find the source of getRandomInt(int n)
public static int getRandomInt(int n)
//package com.java2s; //License from project: Apache License import java.util.concurrent.ThreadLocalRandom; public class Main { public static int getRandomInt(int n) { return getThreadLocalRandom().nextInt(n); }//from w w w . j av a 2 s .c o m public static ThreadLocalRandom getThreadLocalRandom() { return ThreadLocalRandom.current(); } }