Java Random Int generateRandomInt(final int max)

Here you can find the source of generateRandomInt(final int max)

Description

generate Random Int

License

Open Source License

Declaration

public static int generateRandomInt(final int max) 

Method Source Code

//package com.java2s;

public class Main {
    public static int generateRandomInt(final int max) {
        return (int) (Math.random() * max);
    }/*from  www. j  a va  2s. c  o m*/
}

Related

  1. generateRandomInt(int min, int max)
  2. generateRandomInteger(int aStart, int aEnd, Random aRandom)
  3. generateRandomInteger(int start, int end)
  4. generateRandomIntegerArray(int size, int min, int max)