import java.io.*;import java.lang.*; //using Math.randomimport java.util.*; //for arraysclass makeNums {//stores the arraylist that records how many hits have been on a certain number//private static int hitsOnTheNumber[] = {};private static List hitsOnTheNumber = new LinkedList(); public static void main(String[] args) throws Exception { makeNums myMakeNums = new makeNums(); final int TOTAL_NUMBERS = 10; //Number of values final int MIN = 1; //bottom of random range final int MAX = 10; //top of random range System.out.println("Random numbers demo, in the range " + MIN + " to " + MAX + "."); //generate and pring random numbers for (int i = 0; i < TOTAL_NUMBERS; i++) { //sets all the values to 0 - they have been hit on the randomizer 0 times so far hitsOnTheNumber.add(0); } for (int i = 0; i < TOTAL_NUMBERS; i++) { int holder = ( (int) (Math.random() * (MAX - MIN + 1) + MIN)); myMakeNums.recordRandom(holder); } //out.close(); }//end of main private void recordRandom(int randomNumber){ //This method takes in the random number that is generated and records it to //an array list so that we can see how many times that random number has appeared int i = Integer.parseInt(hitsOnTheNumber.get(randomNumber)); hitsOnTheNumber.add(randomNumber, 3); System.out.println(hitsOnTheNumber); }