Here you can find the source of getRandomInt(int max)
Parameter | Description |
---|---|
max | a parameter |
public static final int getRandomInt(int max)
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { private static final Random RANDOM = new Random(); /**/* w w w .j a va 2s .c o m*/ * Get a random int within [0, max) range. * @param max * @return */ public static final int getRandomInt(int max) { return RANDOM.nextInt(max); } }