Java Random Number generateRandomNumb(int randomSize, int range)

Here you can find the source of generateRandomNumb(int randomSize, int range)

Description

generate Random Numb

License

Open Source License

Declaration

public static int[] generateRandomNumb(int randomSize, int range) 

Method Source Code

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

public class Main {
    public static int[] generateRandomNumb(int randomSize, int range) {

        int[] randomNumb = new int[randomSize];

        for (int i = 0; i < randomSize; i++) {
            //generate random numbers
            randomNumb[i] = (int) (Math.random() * range) + 1;
        }//from www .j a  v a2  s.  c  om

        return randomNumb;
        //return array
    }
}

Related

  1. createRandomNumber()
  2. createRandomNumber(int index)
  3. distinctInts(int from, int to, int number)
  4. generateRandomNum(int i)
  5. generateRandomNum(int passNumber)
  6. generateRandomNumber()
  7. generateRandomnumber(int firstNum, int restNum)
  8. generateRandomNumber(int from, int to)
  9. generateRandomNumber(int length)