Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Random;

public class Main {
    public static double nextDouble(int lower, int upper) {
        Random ra = new Random();
        int n = lower + ra.nextInt(upper - lower);
        double m = ra.nextDouble();
        return n + m;
    }

    public static int nextInt(int lower, int upper) {
        Random ra = new Random();
        return (lower + ra.nextInt(upper - lower + 1));
    }
}