Java ThreadLocalRandom getRandomInt(int limit)

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

Description

get Random Int

License

Apache License

Declaration

public static int getRandomInt(int limit) 

Method Source Code


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

import java.util.concurrent.ThreadLocalRandom;

public class Main {
    private static final ThreadLocalRandom RANDOM = ThreadLocalRandom.current();

    public static int getRandomInt(int limit) {
        return RANDOM.nextInt(limit);
    }/*from   w  ww .j  a  va2 s  .  c  o  m*/
}

Related

  1. getRandomElement(List elements)
  2. getRandomFloat()
  3. getRandomId(@Nonnull Random random, int length)
  4. getRandomInt()
  5. getRandomInt(int a, int b)
  6. getRandomInt(int n)
  7. getRandomInt(int r)
  8. getRandomInteger()
  9. getRandomIntegerElement(List list)