Here you can find the source of getRandomNumber(int num)
Parameter | Description |
---|---|
num | a parameter |
public static int getRandomNumber(int num)
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { static Random generator = new Random(System.currentTimeMillis()); /**/*from w w w .j a v a 2s. co m*/ * @param num * @return */ public static int getRandomNumber(int num) { int randomNumber = generator.nextInt(num); return randomNumber; } }