Java tutorial
//package com.java2s; import java.util.Random; public class Main { public static int getNumberByMaxNum(int maxNum) { return new Random().nextInt(maxNum); } }