call nextDouble() to get next random double value


/*
 * Output:
 * 
 * 0.8102628210601169
 *  
 */

import java.util.Random;

public class MainClass {

  public static void main(String args[]) {
    Random rand = new Random();
    System.out.println(rand.nextDouble());
  }
}
Home 
  Java Book 
    Essential Classes  

Random:
  1. Random
  2. Call nextInt() to get random integers
  3. call nextDouble() to get next random double value
  4. Call nextGaussian() to get next double value centered at 0.0 with a standard deviation of 1.0.