Java Random Int generateRandomIntegerArray(int size, int min, int max)

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

Description

generate Random Integer Array

License

Open Source License

Declaration

public static Integer[] generateRandomIntegerArray(int size, int min, int max) 

Method Source Code

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

import java.util.Random;

public class Main {
    public static Integer[] generateRandomIntegerArray(int size, int min, int max) {
        Random random = new Random(System.currentTimeMillis());
        Integer array[] = new Integer[size];
        for (int i = 0; i < size; i++) {
            array[i] = random.nextInt(max - min + 1) + min;
        }/*from   w w  w  . java  2  s .  c  om*/
        return array;
    }
}

Related

  1. generateRandomInt(final int max)
  2. generateRandomInt(int min, int max)
  3. generateRandomInteger(int aStart, int aEnd, Random aRandom)
  4. generateRandomInteger(int start, int end)
  5. generateRandomIntegers(int numbersNeeded, int bound)
  6. generateRandomIntInRange(int min, int max)
  7. generateRandomIntObj(int range, int noOfElements)
  8. generateRandomInts(int range, int noOfElements)