Random: nextDouble : Random « java.util « Java by API





Random: nextDouble

 
/*
 * 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());
  }
}
           
         
  










Related examples in the same category

1.new Random(int intValue)
2.Random: nextInt()
3.Random: nextGaussian()
4.Random: nextLong()
5.Vector: removeElementAt(int index)