get Random Int - Java java.lang

Java examples for java.lang:String Random

Description

get Random Int

Demo Code


//package com.java2s;

import java.util.Random;

public class Main {
    public static int getRandomInt(int range) {
        return new Random().nextInt(range);
    }//from   w ww .  j av a 2  s. c  o m
}

Related Tutorials