Here you can find the source of createRandomNumber(int index)
public static int createRandomNumber(int index)
//package com.java2s; //License from project: Open Source License public class Main { public static int createRandomNumber(int index) { int value = (int) (Math.random() * index + 1); return value; }/*from w ww . j ava2 s . c om*/ }