Java ThreadLocalRandom getRandom8()

Here you can find the source of getRandom8()

Description

Generator an random int in 10^7 ~ 10^8
Use nextInt(int origin, int bound) in JDK 1.7

License

Open Source License

Return

random int

Declaration

public static int getRandom8() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.concurrent.ThreadLocalRandom;

public class Main {
    /**/* w ww. ja va 2 s  .c om*/
     * Generator an random int in 10^7 ~ 10^8<br>
     * Use nextInt(int origin, int bound) in JDK 1.7
     * @return random int
     */
    public static int getRandom8() {
        return ThreadLocalRandom.current().nextInt(10_000_000, 99_000_000);
    }
}

Related

  1. getElement(boolean[] array)
  2. getInt(int bound)
  3. getLetter()
  4. getRandom()
  5. getRandom(int p)
  6. getRandomBetween(int min, int max)
  7. getRandomBoundedInt(int bound)
  8. getRandomDouble(double a, double b)
  9. getRandomElement(E[] array)