Java tutorial
//package com.java2s; import java.util.Random; public class Main { public static double nextDouble(int lower, int upper) { Random ra = new Random(); int n = lower + ra.nextInt(upper - lower); double m = ra.nextDouble(); return n + m; } public static int nextInt(int lower, int upper) { Random ra = new Random(); return (lower + ra.nextInt(upper - lower + 1)); } }