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 float nextFloat(int lower, int upper) {
        Random ra = new Random();
        int n = lower + ra.nextInt(upper - lower);
        float m = ra.nextFloat();
        return n + m;
    }

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