Java Random Int getRandomInt(int size)

Here you can find the source of getRandomInt(int size)

Description

get Random Int

License

Apache License

Declaration

public static int getRandomInt(int size) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Random;

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

    public static int getRandomInt(int size) {
        return rand.nextInt(size + 1);
    }/*from  w ww. j  a va2  s  . c  o m*/
}

Related

  1. getRandomInt(int min, int max)
  2. getRandomInt(int min, int max)
  3. getRandomInt(int min, int max, Random random)
  4. getRandomInt(int minimum, int maximum)
  5. getRandomInt(int sek, int min, int max)
  6. getRandomInt(Random rand, int lower, int upper)
  7. getRandomInt(String level)
  8. getRandomIntBetween(int low, int high)
  9. getRandomIntBetween(int mi, int ma)