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