Here you can find the source of getRandom()
static Random getRandom()
//package com.java2s; import java.util.*; public class Main { private static Random random; /**/* w w w. j a va2 s . co m*/ * @return Shared random generator used in this package */ static Random getRandom() { if (random != null) return random; else return getRandom(System.currentTimeMillis()); } /** * Set up shared random generator to use the given seed. * * @return Shared random generator object */ static Random getRandom(long seed) { random = new Random(seed); System.err.printf("Random generator initialized with seed %d%n", seed); return random; } }