Here you can find the source of randomDouble()
public static double randomDouble()
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { private static final Random random = new Random(); public static double randomDouble() { return random.nextDouble(); }//from w w w . j av a 2s . c o m public static double randomDouble(double min, double max) { if (min > max) { double m = min; max = min; min = m; } return min + (random.nextDouble() * (max - min)); } }