Java Random Int getRandomInt()

Here you can find the source of getRandomInt()

Description

Returns the random integer from min to max value of the system.

License

Open Source License

Return

randomInt, the random integer from min to max value of the system.

Declaration

public static int getRandomInt() 

Method Source Code

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

import java.util.Random;

public class Main {
    /**// w w  w  . j  a va  2s .  c o  m
     * The generator used to generate random integer. 
     */
    private static final Random generator = new Random();

    /**
     * Returns the random integer from min to max value of the system.
     * @return randomInt, the random integer from min to max value of the system.
     */
    public static int getRandomInt() {
        return generator.nextInt();

    }
}

Related

  1. getRandomInt()
  2. getRandomInt()
  3. getRandomInt()
  4. getRandomInt()
  5. getRandomInt()
  6. getRandomInt(final int limit)
  7. getRandomInt(final int max)
  8. getRandomInt(final int maxValue)
  9. getRandomInt(final int min, final int max, final Random random)