Here you can find the source of nextRandInt(int max)
public static int nextRandInt(int max)
//package com.java2s; import java.util.Random; public class Main { private static final Random GLOBAL_RANDOM = new Random(); public static int nextRandInt(int max) { GLOBAL_RANDOM.setSeed(System.currentTimeMillis()); return GLOBAL_RANDOM.nextInt(max); }/*from w w w . j a v a2 s .c o m*/ public static int nextRandInt(int min, int max) { return min + nextRandInt(max - min); } }