Here you can find the source of generateRandomInts(int range, int noOfElements)
public static int[] generateRandomInts(int range, int noOfElements)
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { public static int[] generateRandomInts(int range, int noOfElements) { Random randomGenerator = new Random(); int generatedInts[] = new int[noOfElements]; for (int i = 0; i < generatedInts.length; i++) { generatedInts[i] = randomGenerator.nextInt(range); }/*from w ww . j a v a 2 s .c o m*/ return generatedInts; } }