get Random Double - Java java.lang

Java examples for java.lang:String Random

Description

get Random Double

Demo Code


//package com.java2s;

import java.util.Random;

public class Main {
    public static double getRandomDouble(int range) {
        Random random = new Random();
        int number = random.nextInt(range - 1);
        return number * random.nextDouble();
    }/*from  www .jav  a  2s  . c  o  m*/
}

Related Tutorials