random Double - Android java.util

Android examples for java.util:Random Double

Description

random Double

Demo Code


import java.util.Random;
import android.os.SystemClock;

public class Main{
    private static final Random mRandom;
    public static double randomDouble(double maximum) {
        return mRandom.nextDouble() * maximum;
    }//from  www .  j a  va2s .c  o m
    public static double randomDouble(double minimum, double maximum) {
        return randomDouble(maximum - minimum) + minimum;
    }
}

Related Tutorials