java how to generate a random number between a desired range

java how to generate a random number between a desired range
ref‮‬er to:lautturi.com
/**
 * @author lautturi.com
 * Java example: generate a number between 10 and 20 (include)
 */

import java.util.*;

public class Lautturi {

	
	public static void main(String[] args) {
		int min = 10;
		int max = 20;
		Random r = new Random();
		
		for(int i=0;i<20;i++) {
			int n = min+r.nextInt(max-min+1);
			System.out.print(" "+n);
		}
        
	}

}

output:

19 12 20 12 17 15 15 12 20 14 10 13 16 18 14 17 11 16 19 10

10 and 20 are included.

Created Time:2017-09-11 17:17:57  Author:lautturi