Here you can find the source of getRandomInt()
Parameter | Description |
---|---|
length | a parameter |
public static int getRandomInt()
//package com.java2s; import java.util.Random; public class Main { /**//from www . j a v a2 s . c o m * ThreadLocal Random Variables */ private static final ThreadLocal<Random> random = new ThreadLocal<Random>() { protected Random initialValue() { return new Random(); } }; /** * int Random * @param length * @return int */ public static int getRandomInt() { return random.get().nextInt(9990) + 1; } }