use seed to generate random numbers java code example Example: java random seed Random rand = new Random(System.currentTimeMillis());