get random numbers in a specific range in java

https‮www//:‬.lautturi.com
get random numbers in a specific range in java
/**
 * @author lautturi.com 
 * Java example: get a random number between lowerbound(inclusive) and upperbound(inclusive)
 */

import java.util.*;

public class Lautturi {

	public static void main(String args[]) {

		int lowerbound = 20;
		int upperbound = 100;
		Random rand = new Random();
		int random_integer = rand.nextInt(upperbound-lowerbound+1) + lowerbound;
		System.out.println(random_integer);
	}
}
Created Time:2017-09-27 22:16:48  Author:lautturi