Android Random Int Create nextRandInt(int min, int max)

Here you can find the source of nextRandInt(int min, int max)

Description

next Rand Int

Declaration

public static int nextRandInt(int min, int max) 

Method Source Code

//package com.java2s;

import java.util.Random;

public class Main {
    private static final Random GLOBAL_RANDOM = new Random();

    public static int nextRandInt(int max) {
        GLOBAL_RANDOM.setSeed(System.currentTimeMillis());
        return GLOBAL_RANDOM.nextInt(max);
    }/*from   w w  w. j av  a2s.co  m*/

    public static int nextRandInt(int min, int max) {
        return min + nextRandInt(max - min);
    }
}

Related

  1. nextRandInt(int max)
  2. getRandom(int from, int to)
  3. getRandomId()
  4. getRandomIntNum(int limit)
  5. getRandom(int from, int to)