Here you can find the source of getRandomInt(int limit)
public static int getRandomInt(int limit)
//package com.java2s; //License from project: Apache License import java.util.concurrent.ThreadLocalRandom; public class Main { private static final ThreadLocalRandom RANDOM = ThreadLocalRandom.current(); public static int getRandomInt(int limit) { return RANDOM.nextInt(limit); }/*from w ww .j a va2 s . c o m*/ }