Here you can find the source of randomDouble()
static double randomDouble()
//package com.java2s; import java.util.Random; public class Main { /**/*from w w w . j a v a 2 s . c om*/ * this method returns a random number n such that * 0.0 <= n <= 1.0 */ static double randomDouble() { Random r = new Random(); return r.nextInt(1000) / 1000.0; } }