random Number In Range - Android java.util

Android examples for java.util:Random

Description

random Number In Range

Demo Code


//package com.java2s;

import java.util.Random;

public class Main {
    public static int randomNumberInRange(Random random, int minX, int maxX) {
        return minX + random.nextInt(maxX - minX + 1);
    }//  w w  w  . jav  a2 s.  com
}

Related Tutorials