Here you can find the source of getRandomInt(int sek, int min, int max)
public static int getRandomInt(int sek, int min, int max)
//package com.java2s; /**//ww w.java 2 s . c o m * Copyright (c) 2014 http://www.lushapp.wang * * Licensed under the Apache License, Version 2.0 (the "License"); */ import java.util.*; public class Main { public static int getRandomInt(int sek, int min, int max) { Random random = new Random(); int temp = 0; do { temp = random.nextInt(sek); } while (temp < min || temp > max); return temp; } }