Java ThreadLocalRandom randomInRange(int min, int max)

Here you can find the source of randomInRange(int min, int max)

Description

random In Range

License

Open Source License

Declaration

public static int randomInRange(int min, int max) 

Method Source Code


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

import java.util.concurrent.ThreadLocalRandom;

public class Main {
    public static int randomInRange(int min, int max) {

        int random = ThreadLocalRandom.current().nextInt(min, max + 1);

        return random;

    }//from  ww w . ja  va  2 s.c o m
}

Related

  1. randomElement(Collection c, int n, boolean unique)
  2. randomEnum(Class clazz)
  3. randomFishType()
  4. randomFixedChars(int size, List pool)
  5. randomIndexs(int count, int bound)
  6. randomInt()
  7. randomInt(int bound)
  8. randomInteger(int min, int max)
  9. randomIntegerList(int min, int max, int minLength, int maxLength)