Java tutorial
//package com.java2s; import java.util.Random; public class Main { /** * use and random value,maybe this can provide good experince * * @param min * @param max * @return */ public static int getRandom(int min, int max) { Random random = new Random(); return random.nextInt(Math.abs(max - min)) + min; } }