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

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