Java Random Number getRandomNumber()

Here you can find the source of getRandomNumber()

Description

get Random Number

License

Open Source License

Declaration

public static int getRandomNumber() 

Method Source Code

//package com.java2s;

import java.util.Random;

public class Main {
    public static int getRandomNumber() {
        Random rand = new Random();
        int min = 1;
        int max = 32768;
        int num = rand.nextInt(max - min + 1) + min;
        return num;
    }/*from w  w  w  .  ja va  2  s  .  c  om*/
}

Related

  1. getRandomNum(double pSngBegin, double pSngEnd)
  2. getRandomNum(int len)
  3. getRandomNum(int pwd_len)
  4. getRandomNumAndLetterAF(int len)
  5. getRandomNumAndStr(int length)
  6. getRandomNumber()
  7. getRandomNumber()
  8. getRandomNumber()
  9. getRandomNumber()