Java Random Int randomWithinRange(int min, int max)

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

Description

random Within Range

License

Open Source License

Declaration

public static int randomWithinRange(int min, int max) 

Method Source Code

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

public class Main {
    public static int randomWithinRange(int min, int max) {
        return (int) Math.round(Math.random() * (max - min) + min);
    }//from w  w  w.j  a  v a 2  s .  com
}

Related

  1. randomString(int size)
  2. randomString(int size, String... keys)
  3. randomStringNumbers(int len)
  4. randomtest(int max)
  5. randomText(int length)
  6. randomWithRange(int min, int max)
  7. randomWord(int wordLength)
  8. randomZeroString(int length)
  9. randowPartition(int[] array, int q, int p)