Here you can find the source of generateRandomSeed(int min, int max)
Parameter | Description |
---|---|
min | a parameter |
max | a parameter |
public static int generateRandomSeed(int min, int max)
//package com.java2s; //License from project: Apache License public class Main { /**// w w w . j a va2s. co m * Generate min ~ max random number * * @param min * @param max * @return */ public static int generateRandomSeed(int min, int max) { if (min == max) { return min; } double seed = Math.random() * (max - min) + min; return (int) Math.round(seed); } }