Java Random Number getRandonNumber(int range)

Here you can find the source of getRandonNumber(int range)

Description

get Randon Number

License

Open Source License

Declaration

public static int getRandonNumber(int range) 

Method Source Code

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

public class Main {
    public static int getRandonNumber(int range) {
        return randomNumber(range);
    }//from ww  w .  ja va 2  s.com

    public static int randomNumber(int range) {
        java.util.Random rnd = new java.util.Random();
        long seed = rnd.nextLong() / 3;
        rnd.setSeed(seed);
        return rnd.nextInt(range);
    }
}

Related

  1. getRandomNumbers(int range, int count, Random rnd)
  2. getRandomNumberString(int length)
  3. getRandomNumer(int length)
  4. getRandomNumericString(int maxlen)
  5. getRandomPortNumber()
  6. getrannumber()
  7. getRndNumByLen(int lengthOfNumber)
  8. getSerialNumber(int length)
  9. getTenByteNumber()