public class Random2 { public static void main(String[] args) { double x; x = 6.0 * Math.random(); // 6*0.0 = 0.0 x = 6.0 * Math.random(); // 6*1.0 = 6.0 x = 6.0 * Math.random(); // Range = [0.0 .. 6.0) } }