Java Random Int getRandomInt(final int limit)

Here you can find the source of getRandomInt(final int limit)

Description

get Random Int

License

Apache License

Declaration

public static int getRandomInt(final int limit) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Random;

public class Main {
    public static int getRandomInt(final int limit) {
        final Random randomGenerator = new Random();
        final int randomInt = randomGenerator.nextInt(limit);
        return randomInt;
    }//from ww w.  j  a  va  2  s  . com
}

Related

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